I have this problem too ... new M1 MacBook Pro 16" with 2 external Samsung monitors, plus leaving MacBook open as Monitor # 1 and the Samsungs as #2 and #3. I use the HDMI port for 1 monitor, and a USBC Multi-port adapter for the other HDMI connection.
Every time my MacBook would sleep the Samsung monitors would switch order, I would go into Display settings and switch them back, and the next day, reversed again.
I spend some time with Apple Support on the phone and ran through a number of possible issues causing the problem, when I thought and asked the support rep if there is an order that the MacBook pick up the monitors when waking up? She didn't know. So I decided to move the USBC HDMI cable to the dedicated HDMI port, and vice-versa.
We tested a few times and it seemed to work. Woke up my MacBook from sleep this morning and my monitors are still in the correct order. It seems that when waking up it recognizes the HDMI port before the HDMI plugged into the adapter.
Hope this solution works for someone else using HDMI port and adapter.