I managed to make it work using 64Bit version of msbuild as this would address the x64 tools.
"C:\Program Files\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe" "C:\Path\To\YourSolution.sln" /p:Configuration=Release /p:Platform=x64