How to fix Turnkey returned an error : Code 1 ?

a) verify your engine install. Sometimes something goes haywire and it gets screwed up.
b) install a windows SDK that is best for your version of the engine

Consult the documentation for this => Setting Up Visual Studio Development Environment for C++ Projects in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community

c) Sometimes the newest version is not always guaranteed to be the best

You can set the version by hand either in the engine or your project via
Saved\UnrealBuildTool\BuildConfiguration.xml

inside you can add the specific xml segment to set a compiler, windows sdk or msvc version

Here is what I needed for example to compile 5.4 without errors

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<WindowsPlatform>
<WindowsSdkVersion>10.0.22621.0</WindowsSdkVersion>
</WindowsPlatform>
</Configuration>

You can find your SDK versions in you sdk install dir \10\include

In my case I have mine in d:\Windows Kits

You can see your specific sdk folders and try them out one by one until a version syncs up with the engine correctly.

You can then try enforcing a new SDK Check