You can never test SAML SSO locally because that would be a serious security breach. SAML can only be tested in the cloud and on the IdP side you need to make different setups for each environment URL. And that is the reason why this never works locally because it will only work on the defined URL.
Regards,
Ronald