Player gets disconnected when destroying character

Hi, I have been trying to figure this issue out for quite a while but each time I try to unpossess, destroy and possess the character it kicks that player and doesn’t destroy him.

Here’s some code I have,
https://hasteb.in/iqayuged.cpp

I don’t think this is intended behavior, hopefully can get this solved.

Still getting this issue.

You are calling Destroy on the PlayerController, what would you expect to happen? Maybe you meant to destroy the pawn instead?

That makes sense now, quite a stupid mistake.