Do you have both UE4 and UE5, and built them from source?
I had the same error and found a solution.
- Copy UnrealVersionSelector.exe from “Epic Games\Launcher\Engine\Binaries\Win64” to “[UE4_DIR]\Engine\Binaries\Win64”.
- Run and click ‘Yes’ on prompt “Register this directory…”
- Copy UnrealVersionSelector.exe from “Epic Games\Launcher\Engine\Binaries\Win64” to “[UE5_DIR]\Engine\Binaries\Win64”.
- Run and click ‘Yes’ on prompt “Register this director…”