Yeah, this has been an issue since launch.
There are various versions of this bug, the worst one is when the revive UI disappears and you can't do anything other than quit the game.
Getting squad-wiped used to bring you back into a playable state, but then years ago the developers refactored the death-flow specifically to solve some issues and make it easier for them to debug, and in the process they accidentally(?) patched the workaround...
Anyway, from my experience a common trigger is when you die inside a fortification as it's being built. It's kind of outside of your control, but try not to stick too close to fortifications during engagements, especially the larger ones like resupply stations, fixed guns, and the wood platforms. See the first minute of this video for an examples: https://www.youtube.com/watch?v=ReyfPuz0qPc