The problem I had was this line.
return array(true, $idp_sso_url . '?SAMLRequest=' . base64_encode(gzdeflate($authnRequest)));
The $idp_sso_url from Google already had a parameter in the URL, so my use of "?SAMLRequest=..." needed to be "&SAMLRequest=..."