STM32 UART reliability with high baud rate
Sounds like a flow control issue to me. A Wifi module requires this at higher baud rates, because it can't send out packets at full speed - the internal buffers run full. If your MCU supports it you should use an UART with hardware flow control signals (usually called RTS and CTS).