vm.errors.GvmResponseError: Response Error 400. Only command GET_VERSION is allowed before AUTHENTICATE

Hello everyone,
I have been using the code from the API documentation to build an automation scanning.
But when I’m running the code, it gives the error :
“gvm.errors.GvmResponseError: Response Error 400. Only command GET_VERSION is allowed before AUTHENTICATE”

Whereas, I am using the code following from the documentation (for the authentication to the automation scanning) in : https://python-gvm.readthedocs.io/en/latest/usage.html#using-gmp

Does anyone has the idea of why this is happening?