I play versions of myself in a fantasy setting. I emphasize a particular part of my personality and give them funny voices, so no one has caught on. Thankfully people tend to like me for some reason, and therefore my characters, but that is why I always forget to make the player versus player character distinction.
You are absolutely right, and I have always got buy in from players, I just never thought about how badly things could have gone if I hadn’t been doing that so I have edited my comment. For narrative reasons I always think players should have a say in their characters death, it helps me as a DM and can lead to fantastic world building opportunities. Thankfully I’ve never killed a PC without consent for that reason.