Longhorn Cowfish are notorious for this. The 2 I owned both eventually wedged themselves into rock and died. Unfortunately for cowfish the stress of being stuck will kill them within a few hours

The second one I owned I managed to get stuck twice (thankfully I had been home both those times) and I was able to get him unstuck fairly quickly, even moved the rock around to prevent him getting stuck again. Sadly though the 3rd time he got stuck it killed him and happened while I was at work and couldn't save him

For that reason I will not have another longhorn cowfish in my current tank set up.
I'm also pretty sure I had a wrasse that got stuck in the rock and died, but I can't 100% remember.