Forum broken for Admin - Assets missing?

I encountered this problem again today after I’d copied over the production app.yml to the standby server and rebuilt Discourse on that server. I presume it’s related to the S3 bucket and Cloudfront somehow but I don’t understand why there’s a conflict just from the rebuild.

It happened during testing of a script I’ve written to switch over the forum to a standby server and set that one as production. Usually I’d complete the switchover by re-pointing the reserved IP to the other server but I didn’t test that part in this run. I rebuilt the production app and things are working normally again but I’d like to understand the problem if anyone can help.