On two different Macs I get intermittent errors where SDK include files are not found.
The file that contains the include statement, and the included file not found are different most times. When I check for the file it exists.
A rebuild often works.
Xcode 13.1 with MacOSX12.0.sdk
and 13.3 with MacOSX12.3.sdk
I've looked in the system console for error around the failure time,
but cannot see anything.
AFAIK i do not have any automatic updates selected.
I checked timestamps of files/folders involved, and none are recent.
Example error:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/algorithm:653:10: 'memory' file not found
#include <memory>