As of February 2025 / Edge version 133.0, the current fix does not work because the allow-insecure-localhost flag is no longer available in the temporarily unexpired flags.
This can be fixed by modifying Edge's policies [1]: Use the SSLErrorOverrideAllowedForOrigins policy [2] or, more broadly, the SSLErrorOverrideAllowed policy [3]. These can be set in Intune or in the registry (see links). Setting the former policy to ["https://localhost"] works.
[1] edge://policy
[3] https://learn.microsoft.com/en-us/DeployEdge/microsoft-edge-policies#sslerroroverrideallowed
(Copied from my answer at https://stackoverflow.com/a/79428053/21257318)