And… this was the issue! Thank you for pointing me in the right direction!
I had to delete the file I was using to force VS2022 with UE 4.27 (I even posted it as solution here), this means it’s probably time to remove 4.27 from my pc
EDIT:
After being able to change the engine version I had another error saying:
UnrealBuildTool has banned the MSVC 14.39.33519-14.39.99999 toolchains due to compiler issues. Please install a different toolchain such as 14.38.33130 by opening the generated solution and installing recommended components or from the Visual Studio installer.
I had to install a previous MSVC version (MSVC v143 - VS 2022 C++ x64/x86 build tools v14.38-17.8) and I was finally able to compile