XxTriviumxX Hi! I know that if an attacking party has my phone in his hand and knows the pin code shared between 2 users, that would result in a compromise for both users.
If he knows what user profiles are, then yes.
XxTriviumxX But what if I'm able to punch that phone thief in the face? Then, the thief proceeds to try to hack my phone remotely out of spite?
Hmm, bit of a stretch, don't you think? You manage to punch him but he's skilled/resourceful enough to quickly exploit a vulnerability but doesn't abduct you instead 😉. It's difficult enough to gain RCE on stock Android, so how about GrapheneOS? Let alone while locked, preventing the USB-C port to allow new connections (although this depends on your settings).
XxTriviumxX If a hacker knows my 6 digit code to unlock my phone, can he use that code remotely?
If a state actor or dedicated organization is targeting you specifically, it may be possible. I assume you're not in this position, so the chances are little to none. You didn't give your phone to the suspicious man in the back alley or install "free minecraft apk mod 100% no virus," did you? 😉
Remember to develop a realistic threat model. It will make your life much easier 🙂.