Can't authenticate on websocket API from addon

I am trying to write a custom addon. For development, I created one in the /addon folder.

I have set up the following access levels in the config.json:

"hassio_role": "manager",
"hassio_api": true,
"homeassistant_api": true

I am using python to connect to the internal websocket API: ws://supervisor/core/websocket

The authentication token is fetched from the environment variable SUPERVISOR_TOKEN.

Unfortunately, after sending “auth” message, the supervisor responds “Invalid access” and terminates the connection. Extract from my log:

HA token: fa8740c....fa
### ws connection opened ###
WS message received: {"type": "auth_required", "ha_version": "2021.11.4"}
WS message sent: {"type": "auth", "access_token": "fa8740c....fa"}
WS message received: {"type": "auth_invalid", "message": "Invalid access"}

Does anybody have an idea what else should be configured to allow such access?

(Environment: core-2021.11.4 @ Home Assistant OS 6.6 on a RaspberryPI 3)

Never mind, after several attempts I restarted the host device and after rebooted it worked immediately.