This may be part of your issue or not, but it does appear to me to indicate a problem. I refer to the last paragraph of your second post, on "Sunday at 11:19 am". In that you say you are confident you have good grounding IF you avoid using one questionable output from the UPS.
What struck me is the statement, "on one of the 3 pin ports on my UPS (output), there is probably no grounding, so if I turn my PC through that, then the PSU grill gives shock, so does my Keyboard USB-C connector when I touch it." Under normal circumstances, even if your system does NOT have a proper connection of its case to Ground, you will NOT get any shock from it. So that post says things are NOT as expected.
Now, the fact that you get no shocks when you use the other UPS outlets confirms that they do have a functioning Ground, although maybe not perfect. But recognize that, in such a system, a good Ground does TWO things for you. The first is that, IF there is some odd electrical path to allow power line Voltage to reach the exterior of the devices so you can touch it and get a shock, a good Ground will divert that power to Ground and you will NOT feel a shock because the residual Voltage is VERY low. The second is that this Ground connection ALSO means that all shields in the signal CABLES can do their job of preventing noise pick-up from outside signals. THIS can impact any noise appearing in things like sound cables and earphones.
There is a related third factor. With modern electrical cables, plugs and wiring systems, the use of a 3-prong plug on a power cable means that the connections from wall outlet to user device are correct. In such a power cable, the three wires are: Hot line, Neutral line, and Ground. Power flows from the Hot line through the device components to Neutral, and normally no current flows in the Ground line. The Ground line WILL carry small noise signals to Ground because the cable shields in the device are connected to the chassis and thus to that Ground line. IF there is some problem in the power circuits that allows current to leak out to the chassis, then those currents also WILL be carried safely to Ground. When your power cable connection to an external true Ground is NOT present, there is no way to "remove" the small noise signals, BUT if there is NO malfunction of the electrical power circuits in the device that can allow current to "leak out", you will NOT receive a shock when touching the chassis! If you really DO feel a shock - real shock, not a small "tingle" that might be imagined - then there IS a problem in your system somewhere.
In many parts of the world the electrical supply system to your house connects ALL the Neutral lines to true Ground both at the supply transformer on the power lines outside, and at the breaker panel in your home. The Neutral lines are NOT Ground lines because they are carrying significant currents back through the panel to the transformer and thus HAVE a non-zero Voltage on them although that should be small. Related item: normally there should never be any current being carried by the Ground lead in a power cable so that IF it needs to carry a current to Ground safely when a problem occurs there is nothing to impede doing that job.
So where the power lines enter a user device the Hot line goes only to where the power is to be consumed, the Neutral line goes only to where the current is returned to the source, and the Ground line goes only to the chassis that you might be able to touch. In some odd situations IF the wiring in the wall socket OR in the plug on the end of the cable has been done improperly, this might not be correct. But that kind of problem is NOT part of OP's situation. HOWEVER, there IS a way things can get "wrong" when you have equipment with an older TWO-prong plug on a device's power cable. Now, the most recent design of 2-prong plugs attempts to prevent a problem here by having the prongs of DIFFERENT widths so that they only can plug into the wall one way. But even that can be defeated by misuse, and there ARE devices with plugs NOT designed with these different prongs. Now, add to that this factor: some consumer devices are made so that the interior circuits allow real power currents to flow to the chassis inside and keep you from touching that chassis. BUT then the NEUTRAL line is connected to that chassis AND any cable shields also are connected there! Such a device works just fine all by itself, and even OK when connected to some other device IF the power plug is connected correctly so that the wall's HOT line does actually go to the power input points, and the NEUTRAL line goes to the chassis. BUT if the plug on the power input cable for this device is put into the wall socket upside down, then Hot and Neutral are REVERSED! The chassis can be at high Voltage but YOU are not aware because you cannot touch it. However, any SHIELDS on attached cables then can have Hot line Voltage on them! THAT may expose the user to electrical shocks at a different spot in the whole system of devices where a cable shield or a chassis part can be touched! Plus, it can introduce noise signals and hum in the connecting cables.
So, it you suspect this, how can you find and fix? There is a simple way that just takes a bit of time. Basically you disconnect the many interconnected devices in a system and start with the minimum, looking for symptoms of the shock. Then you re-connect the devices one at a time until you find one that causes the problem. Then you try to turn over the plug on that device if you can and see if the problem disappears.
OP, in your case, connect your system to the UPS in the way that DOES cause you to experience shocks at the case and cable conectors. Now, disconnect all the signal cables of your peripheral devices like printers, scanners, modems, etc. AND for each device unplug it from its power source socket. That should leave only your computer connected - for now, even the monitor should be disconnected so you can't see anything there. Now check for shocks on the computer case and there should NOT be any. Assuming no shock, re-connect the Monitor signal cable AND its power plug. Check again for shocks. IF you get a shock, try to unplug the power cable for that unit and then plug it back in after turning it upside down. (Obviously, if the plug is the 3-prong type you cannot do that!) If this eliminates the shocks you know you found and fixed one cause. IF this cannot be done becasue of plug configuration but you DO have shocks with this device plugged in, then that device itself has an internal problem.
Once you have one peripheral plugged in and still NO shocks, go on to the next device to add to the system. Continue to add one at a time, checking for shocks and trying to eliminate. Eventually you should get ALL devices re-connected and still NO shocks. OR you may find that one device casues a problem no matter how it is connected, and that is a different issue with THAT device only.
When you have all your system operating with no shocks, you should move the connection to the UPS output to one that you know DOES have a good Ground connection. Now you have a system which has no hazardous electrical leakage causing shocks. MOREOVER, you should have a system with noise-free signal cables thoughout so the noises in your earphones should be gone.