it's an interesting mechanic and has good potential, unfortunately bit hard to collider issues. a suggestions could be you make the character your switching into unable to take damage for a few seconds to avoid the insta-kill from enemies nearby.
Thanks, will do!