One would typically design rockets to not hang out for a while in the transonic region. It's a different optimization problem than a plane cruising near mach, +/-. Our rockets would either punch through mach to go quite a bit faster (high performance minimum diameter rockets), getting back down to transonic and subsonic at higher altitudes where drag is lower, or they don't go through mach at all (lower powered or lower performance big dumb rockets and similar). If one takes the gloves off, one can design rockets which would approach M5 for a single stage, and not make it back to transonic until up around 100Kft or so where it just won't matter. But they'd melt on the way up, and definitely wouldn't be using commercial motors. I've simmed such rockets in RasAero using motors that would survive static test but are not the usual designs. There are a few tricks. But the casing couldn't take the external heating along with the internal. It might not fail getting up to speed because that happens quickly, (but it might anywhere past M3), but it won't survive at speed unless I can come up with an economical way of making it take some more heating.
Gerald