This issue is fixed in the ArcGIS Online 7.2 release (June 2019), refer to BUG-000122423. Since ArcGIS Enterprise 10.7.1 was released around the same time, it did not make it to 10.7.1, the fix is in ArcGIS Enterprise 10.8. Users are recommended to upgrade Portal for ArcGIS to 10.8.