Historically command-line tools for android were downloaded through the android developers webpage. When installed they were used to update other components. The problem with that was that there was no easy way to update command-line tools themself. This was now changed so that they are also distributed through SDK manager.
The issue at the moment is that, if you installed command-line tools through the old system, they won't get updated. So some changes are required for this to happen.
First, we need to install new cmdline-tools, through old sdkmanager.
sdkmanager "cmdline-tools;latest"