I'm not an expert on Swift, but I can only guess that code injection mechanism that's been used for Previews resolves changes incorrectly.
Or the state got out of sync, so it's safer to rebuild the project rather than crash/timeout. Which unfortunately happens quite often, even after rebuild.