I was also getting the same issue the reason for that is swift is somehow saving the temporary file somewhere else and is expecting to get that file from somewhere else
error: the replacement path doesn't exist: "/var/folders/xr/s05r623x35q5112r44hjscp40000gn/T/swift-generated-sources/@__swiftmacro_8LearnFun11ContentViewV5items33_4D86A9023CAFA1CD6AABE6049862A858LL5QueryfMa_.swift"
here The expected file should be inside swift-generated-sources but xcode is saving it to one folder above that is in T folder
laziest fix: for the compiler not to compain is to create the folder swift-generated-sources and then move the file inside that folder and if the error is still there then just rename the file to match the one in the error mine was @__swiftmacro_8LearnFun11ContentViewV5items33_4D86A9023CAFA1CD6AABE6049862A858LL5QueryfMa_.swift