Have you tried an OEM Apple cable or a cable with the Built for iOS devices branding on the packaging? Most of the reason why this pop up occurs is because of a cable without additional power protections built in. It could also be an issue with the dock/lightning port, but the other thing that comes to mind is there may be damage to the TriStar chip on the logic board. Which is much more complex repair. And requires microsoldering skills to fix.
It’s up to you whether or not it’s worth it to you to sink additional money into repairing the device, I would be shocked if it ended up being supported on iOS 16. But be aware that the dock may not be the issue at all.