It happened because since version (6200805) Command Line Tools should be placed inside cmdline-tools directory. It should be created manually in ANDROID_HOME.
Please see this answer With the mentioned configuration everything works fine.
I found that Spotify or any media related control app seems to always be chatting over the network keeping it awake and active.
A Google Home assistant type device like Home Mini can cause the same issue, especially with the 'Let others control your cast media' option.