There are some instances where it might potentially help - when your team is under stress (real or perceived). Light humor (if well done), might alleviate some of the tension in the room and let them focus on work.
One thing is for certain, NEVER put jokes or sarcasm in writing.
I've read way too many of those in court.
You can still be kind, empathetic and polite to everybody you work with. But avoiding authentic personal relationships at work is very sensible, along with having very clear personal boundaries. Normal colleagues can form cliques of people they trust, but it’s not a great outcome for management to be participating in that, even though that’s what usually happens.
“Bring your true self to work” and other modern workplace nonsense is risky advice to take seriously. It’s mostly a coded communication that does not mean what it appears to on the surface.