HTTP/URI.php#L599 assumes the only URI schemes are http and https and therefore ignores other URI schemes when using forceGlobalSecureRequests.
This is allread tackled in Helpers/url_helper.php#L65 and HTTP/IncomingRequest.php#L411.
Since this is required in multiple places and therfore error-prone, maybe consider outsourcing this to one tested static method.
Even introduced this differing behaviors in the same commit 89d588f
d( (string) new URI('ftp://localhost') )
// Wrong Output -> "https://localhost"
// Expected Output -> "ftp://localhost"