I think you are getting the 2 auth modules confused. Make sure you follow the instructions for the auth module you want to use.
I think you are trying to use this one, and getting the out of bounds errors: https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-netconnection-connect-onconnectauthenticate
But you really want to use this one: https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2
Can you try OnConnectAuthenticate2 with the corresponding instructions and see if that works for you? Thanks!