Thank you for responding despite my vagueness.
Apple MacBook Air M1, 8 GB, MacOS Sonoma 14.2.1, Xcode 15.2--I forgot to paste it from the TSI message.
After a few hours, I got the "Cannot preview in this file" error.
I’ve noticed that my derived data folder has a different location according to Xcode and Finder.
According to Xcode, the root path is /Users/filippo.
But, according to Finder, it's /Users/Filippo.
I changed my username a year ago.
If you think this issue could be related to my problem, please tell me how to solve it.