Can’t you detect it client side? Send the contents of the username field to the backend, if it’s SSO change the password field to “login with ssoprovider.com”
It's even worse user experience since things change as you type (you have to wait for network round trip so it's not instant), plus password managers are still confused.