95% of the time when this happens with any of my devices, getting a needle or a soft bristled toothbrush (or both) and cleaning out the USB-C port of any debris usually fixes any problem. Sometimes it looks like there's nothing in there but you'd be surprised. I literally just did this with my S23 Ultra last week, but I've done this at least 3 or 4 times prior to instant success. The other 5% of the time it was a faulty cable.
Not to say it won't be an issue with the port but in most circumstances it's just a bit of debris and can be easily rectified.