My Xperia XZ charges now only when it is connected with a PC via an USB port (and only some USB ports work) .
It recognises when I plug it to a wall charger (the LED is 3 seconds red), but it won't charge.
I tried the following to fix:
-Forced shot down
-Trying with different cables
-Trying on different locations
-Cleaning all openings with air compression
-let it plugged in to the wall for very long time and overnight.
Nothing helped. The issue appeared not long after I updated the phone to Android 8.0.0 (I had an old version and had to update 3 or 4 times to get to 8.0.0), so I'm not sure if the update is the cause of the problem.
If the you have tried all troubleshooting steps from your first post and different sockets as @Quester mentioned and the phone still does not charge as intended, I am afraid the only thing left to do is to get in contact with your local support team In order to have your phone sent to an authorized service center.
If you have any questions regarding the service, such as routines, warranty and consumer laws, these type of questions are best answered by your local support team as well, as they vary between markets.
Feel free to return if you have further questions!