Thank you for the error details. Checking around with my peers, this looks like a shader compiler error, either due a GPU conflict, or the system running out of memory. And it happens while attempting to compile a FlattenMaterial:
As for possible causes for conflicts like this, it can be related to drivers, virtual memory, or file corruption. So, let’s take steps to resolve said causes:
Perform a driver clean up, using any unistaller of your choice, then re-install your drivers with the most stable version available. If you are on nVidia, you can pick Developer drivers, which are best suited for engine work
Clear up your project’s cache, via deleting folders Saved, Intermediate, and DerivedDataCache from your project’s main directory. After that, re-open UE, and allow the project to regenerate
I tried several workarounds, including reinstalling GPU drivers and reinstalling build tools, but none of those worked for me. Ultimately, the only solution that worked was building Unreal Engine 5 directly from source. After switching to the source-built version, everything has been running smoothly.