I was about to my XS to Apple so they can pull it apart to replace the side Button. I never dropped my phone and always kept it in a very good case.
Assistive touch was the temporary solution but I couldn’t let it go...
Tried re-starting multiple times via assistive touch but didn’t work.
Took the risk of turning the device off from the main settings and could not turn it on from the button anymore (scary right?). Luckily I knew that if your phone is off and the battery is not too low, connecting the lighting cable will turn your device on.
After the device started, tried the power button and YES! It worked again!!!
A very simple solution that worked in my case, turn it off and fingers crossed it turns back on!
Good luck