After wear and tear I have replaced the PS4 controller analog sticks which had gone bad. You can find the parts cheap when searching for "analog sensor module ps4" on eBay. The 'ALPS' module is basically two potentiometers, a microswitch (L3/R3 button) and the plastic stick encased in a package with 14 pins which is soldered to the board/PCB of the PS4 controller.

Desoldering the original 14 pin modules was pretty hard, tried a solder sucker first, but ended up using the SMD rework station to heat up the pin area on the board while protecting the rest of the board using Kapton tape and gently pulling the stick out.

Here's a photo of the soldering after replacing the modules.

...and this is what the new modules looks like after replacement.

After reassembling the controller and testing a bunch of games it worked fine, I can actually aim again when playing GTA Online.

Then my daughter tried Overwatch for PS4 and the menu system kept scrolling the selector bar downwards as if the analog controller wasn't centered. After searching around this seems to be an issue many Overwatch players suffer from, and even buying a new controller didn't always solve the issue, first report around 2016 and still not fixed. Overwatch works when playing the actual game, only the menu system suffers from this "narrow analog dead zone bug" and none of the official suggestions of reinstalling the game and deleting settings helps, it's clearly bad programming in the menu system causing this where the dead zone detecting a centered stick is hardcoded too narrow.

So, I got this idea to make a hardware patch using a resistor in the controller, since Blizzard don't seem to care about fixing this in their software. After a lot of experimentation the working fix was a 1.5k Ohm resistor on the voltage input pin of the vertical potentiometer (part of the sensor module) which has three pins total. I lifted one pin of the potentiometer to solder the resistor in series with the voltage input.

Here's a photo of the resistor installed.

I assumed it would work, but after fixing the pot so the menu didn't scroll vertically, it turns out the horizontal pot was off as well, so had to install another 1.5k Ohm resistor there also.

After "hardware patching" both vertical and horizontal potentiometers Overwatch menus finally work fine.