Getting a "PipelineCacheUtilities.cpp" error when trying to add PSO cache to project

I’m trying to learn how to create PSO caches for Unreal Projects; I’m currently using UE 5.2.1. I followed the PSO caching documentation as best I could, and managed to generate a .spc file with no errors to speak of:

However, when I attempt to re-cook the project and add the PSO cache to it, I am met with some errors:

Following them to the engine source file, I wasn’t able to make heads or tails of what’s going on. If I remove the .spc file that I moved to the Project/Build/Platform/PipelineCaches folder that I created, then the cook is successful but obvious the PSO cache isn’t being added in that case. Is there anyone who can help? I’ve attached a copy of the most recent project logs.
FPShooter.log (922.3 KB)

I got the same error.
My problem was the .spc that I built targeting PCD3D_SM6 was built with only SM6 .rec.upipelinecache files, but with both SM5- and SM6 .shk files as inputs, mixed.
This triggers the cooker to stop (check(OutTargetPlatform == Iter.Key().TargetPlatform);).

Here’s how I fixed it:
The easiest solution is to make sure input files for different shader models aren’t mixed in the same folder of inputs. But you can also add the correct prefixes and suffixes to the wildcards in the call to ShaderPipelineCacheTools. For instance *PCD3D_SM6.shk instead of just *.shk.

If correct, you should be able to see in the log for the tool that it only picks the selected shader models for the input files.