The issue is 100% recreateable.
#1 Set Screen lock time to 30 seconds
#2 let the device fall asleep by itself
#3 wait 30 seconds after it has fallen asleep
Now try to Plug in without tapping the display. And Plug In.
The device will not register that it is plugged in.
Also I Have Raise to Wake Disabled Apple May simply insist that Raise to Wake must be on that way the device wakes up with any movement.
Can confirm that my XS Max DOES NOT have this issue. I recreated what you typed, including disabling Raise To Wake, and my phone charges immediately after I plug the cable in. That's either via power brick or from my iMac USB.