I personally had this issue on my S21 ultra when I went to India on holiday in the monsoons and the whole time I was there I had the issue you described.
Tried the whole shebang of things and found I could still wirelessly charge it.
So had to slow wireless charge the whole 4 week's holiday while I was there.
Came back to the UK and miraculously it started to charge again via cable.
This was last year and no issues since.
All I would say is if you tried everything leave the phone out on a table some where switched off or something for a couple of days and see if it sorts itself out.
Mine seemed to be change of environment that caused the phones self preservation kick in somehow.
Follow Me, like my posts and Mark as Solution if I helped solve your Problems.