Thanks to all who replied with suggestions. TL;DR It looks like the new SSD might be faulty. Here is what I did.
- Restarted in safe mode. Selected Apple Menu > Sleep. Machine crashed again. I noticed that the machine actually appeared to wake up before crashing, so the crash might actually be happing during the wakeup.
- Restarted in Apple Diagnostics. Diagnostics reported error code "VCH002: There may be a problem with a storage device."
The new SSD was an OWC Aura Pro X2. I will contact OWC to see if they have suggestions. I update once I speak with OWC.
In case that doesn't work out, here is the additional information people asked for.
The model is iMac17,1. I performed a clean install of 11.5.1, and then migrated data and apps from a Time Machine backup. Here is the last kernel panic log. Sorry, can't seem to figure out how to get a plain text version.