I've had the same issue with both my iPad and iPhone 15 Pro, and now my new home hub mini. The attempts to charge/work and just looks like it's connecting/disconnecting rapidly. I've tried a combination of cables (Apple v non) etc, and both have been checked to be thoroughly clean. The summary of where I've gotten to:
-- I only get the problem with USB-C to USB-C connection. If I use the same sockets/chargers etc with USB-A to USB-C it's absolutely fine.
-- Using the same ports with an USB-C to USB-C cable charge any other non-Apple devices without any problem (even a power heavy 15" PC Laptop).
-- If a magsafe is used on the same ports, again charges completely fine.
-- I have Power sockets in the house walls that have both USB-C and USB-A ports built in. Using the USB-A socket they charge fine, not the USB-C.
---- Electrician has checked the supply from these - said they are fine, but said the Apple devices appear to be controlling how much power is being drawn and it the device itself thats stopping it from charging. Electrican has confirmed these as being able to output in the following 5V DC 3A - up to 15W, 9V DC 2A - up to 18W, 12V DC 1.5A - up to 18W and designed to work with both USB-PD and USB-QC. So despite the fact the power negotiation with the Apple device is stopping it from drawing the power, it should work.
-- Although this has been happening ever since I had the iPhone 15 Pro, it's only started happening with the iPad in the last month. (Don't know if this is timed with an update, as I haven't checked often enough).
I'm at a total loss, Apple don't seem to know (they've just asked me to get in contact after the next update). And I don't really want to go and buy a load of new USB-A to USB-C adapters just so they charge directly.
Thought this might help shed further light on what seems to be a problem for a lot of people.