How to avoid engine destroy the character when player leave or get disconnect

Shouldn’t happen; Epic assumes pawn must be destroyed no matter what, so the GameMode classes and code you’ll have to check to see what else is killing the pawn when unpossessed, since you said that changing PawnLeavingGame() also didn’t work.
There’s something calling Destroy() directly.