I gotta say, cross-conduction (aka shoot-through) is bad at any switching frequency. You should check for that; it might be fixable by adjusting the gate driver circuits.
I have to investigate what is the real source of that problem. Power section is quite nice layed-out, I think. It is not my design but I would give a thumb up for that part of PCB to my colleague

And the problem was also observed on MCU side, before isolated gate drivers, so I presume it just follows junky drive signals. These lines are quite long and one of them is rewired near gate driver because I had to do some pin re-arrangements to free additional hardware connections. But it worked perfectly with 21kHz and 50kHz doesn't sound like astronomic change

Also, do you really need 50kHz PWM? Assuming the same H Bridge, higher switching frequency will always lead to higher switching losses. Also, laminate iron rotors will tend to show lower effective inductance (and higher iron losses) at higher switching frequencies.
I don't know, just to be honest

Company that designed these motors and controllers doesn't hire idiots.. I hope

It's rather top brand. These motors and controlers are designed to work together and their controllers use 50kHz and other parameters that I have already mentioned. So I think there is important reason for that.
I have already mentioned effective inductance and it looks like they know about that problem

And this is why they suggest to use 30-80% of its value in calculations...
Generally I have to check if there is any significant improvement in current ripple. I couldn't hear any difference in motor sound when working at 21kHz and 50kHz, no resonances, buzzing etc. in both situations

I usually use 21kHz just to go above audible range but their 50kHz tortures my brain

Interesting - some kind of timer misbehaviour? Do you use the capture/compare shadow / buffer registers (don't remember real name in the datasheet and ATM I'm too lazy to look that up) so the PWM values get updated at the correct sampling point?
I've experienced some weird effects with STM timers, usually I could resolve them by checking and fixing my code
From my experience, it's highly recommended to handle the bare metal timer, not to use ST HAL code. It's way more efficient and you've got to debug your own code only. Since I'm lazy, usually still leave the basic initialization to Cube/HAL, but no more HAL once it's up and running, especially within timing critical interrupts.
I use HAL only for GPIOs init because in CM4 it is designed so strange that it would be hard to write simple macro to set that and this is done only once at startup

. Other things usually controlled in "bare metal" on registers. I use "preload" on all CCR registers so it's not that. And nothing was changed here between 21kHz and 50kHz.
Of course before blaming MCU vendor I always study datasheet, my code, datasheet, and so on..

But to still have good resolution after increasing output frequency I have switched clock source from PCLK2 to 2xPLL

So now this timer runs at 144MHz

But datasheet claims it can handle that

TBD in reality