My r5s frequently lock up in use with this lens specifically, requiring a battery pull to reset. I don't think this is the fix.
Multiple people including myself have reported lockups such as you describe, but they seem to be completely random, as they've occurred with various lenses, and with multiple different camera settings. FWIW, I've had periodic lockups when using EF 100-400mm and RF 100-500mm, when shooting short RAW bursts with animal-eye AF enabled, and it's happened with mechanical, EFCS and electronic shutter. I use the fastest Delkin and SanDisk CFE-B cards. So far, I haven't had lockups when shooting JPEG bursts.
Even with the camera on default settings, with no custom button changes, some people experience lockups. What is even stranger is that some people (perhaps the majority, who knows?) have never experienced a lockup.
Canon are obviously fully aware of the issue, and are undoubtedly still striving to find out what causes the problems, but I fear that they'll never uncover the cause - it's just something that unfortunate owners will have to live with.
I'd suggest that anyone who buys *any* new camera thoroughly tests it as soon as they get it, and if found faulty in any way, they demand an immediate refund or replacement - in the UK and most other countries there is a statutory "cooling down period" after a sale, in which goods can be returned to the seller. Don't allow yourself to be fobbed off with excuses by the retailer - you are entitled to a refund or replacement if goods are faulty.
... and if it's any consolation, it isn't only the R5 which suffers from random freezes - I've read several reports of exactly the same thing happening with the Sony a7iv (with Sony glass) and I know someone personally who has returned his Nikon Z9 because of inexplicable random freezes. It's virtually impossible for any manufacturer to fully test every possible combination of camera settings, lenses, memory cards and shooting conditions.