The latest version of cmdline tools (7302050_latest) seems to have a different directory structure. The folder is now called cmdline-tools instead of tools so when you extract the folder it won't work as expected. sdkmanager also seems to expect to want to be in ${ANDROID_HOME}/cmdline-tools/latest/bin but extracting it in ANDROID_HOME will just give you ${ANDROID_HOME}/cmdline-tools/bin...
So it looks like unzipping the newest version to ${ANDROID_HOME}/cmdline-tools/cmdline-tools will fix this, and remove the need to run sdkmanager --sdk_root.... Easiest way might just be to mkdir -p Android/cmdline-tools and unzip to there & rename the second cmdline-tools to latest
Not sure how this whole forking gists thing is supposed to work but here are the changes I used: https://gist.github.com/jason-s-yu/30375db45c1f71c1259e042d216e4bd3
Go to https://developer.android.com/studio?hl=PL
wget https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip