The second failedRedirect should not have the code I sent you added to it. I've removed it for you.
That's very strange though, there is already code to retain the querystring built in to the login procedure. The $_SERVER["QUERY_STRING"] must not be set at all.
Try this updated version of the users_LogIn.php file I am attaching. It will display the query string if the $_SERVER["QUERY_STRING"] is set and "Server Query String not set" if the variable is not set. Let me know the results.