2017 iMac crashes when booted from thunderbolt SSD

My dad’s 2017 iMac with the 5400-rpm internal hard drive was painfully slow, so I installed Big Sur on an external 1TB Thunderbolt SSD and migrated the contents of the internal drive onto it. I am able to boot from the SSD normally, and it is fast and usable again – but only for a few minutes. Eventually, MacOS will crash, even without doing anything as a user, and the computer will restart itself. The computer will operate normally, albeit painfully slow, when MacOS is booted from the internal drive. I didn’t notice anything peculiar looking at the activity monitor. What could be causing this? How should I go about diagnosing it?