I’m not 100% sure how you ended up in that state since I couldn’t reproduce it locally…
But I changed the code so that we’re lenient when deleting custom emojis when the associated upload was somehow already deleted.
https://github.com/discourse/discourse/commit/2d48caffdfffd72b51c1b1591ee50cfed3aba199