phtalo wrote:
As I wrote, I already tried resetting. and also did the hardware test.
Without telling us exactly what you did we do not know for sure. Plus Apple has changed how various Macs perform the SMC reset now (M1 Macs don't even have it).
Is the charger connected directly to the laptop? The laptop may not receive the full power of the charger if you connect the charger to a multi-port adapter, dock, or hub.
Have you tried disconnecting all external devices? Many external devices get their power from the laptop and under heavy load the laptop may not be able to provide enough power for everything.
Have you tried charging the laptop with each USB-C port on the laptop especially one on the other side?
Also try rotating the USB-C connector on the charging cable 180 degrees upside down (do it with each port if necessary). I know it sounds crazy, but it can make a difference if part of the charging circuitry in the laptop has a problem (the power circuitry on the USB-C Apple laptops is a pathetic mess). Apple won't detect this failure unless they run their service diagnostic for testing the power adapter (and they should also test your charging cable and charger as well).
It is possible the battery issue you describe may only occur at a certain charge level. I have found many Apple batteries tend to develop a "dead" spot usually somewhere between 1% to 20% (sometimes 30%) where the battery may misbehave (usually this happens on well used batteries, but I've seen it with batteries that should still be good -- still above 80% of original design capacity).
Just today I was working on a USB-C MBPro the client said had charging issues, but at first I could not detect any problems. Then during some extended testing where I was stress testing the laptop using "mprime" to drain the battery so I could charge it again I noticed the laptop powered off too early. I then discovered the battery appeared to work fine under light loads, but if the system was under heavy load the bad spot in the battery kicked up. I even saw the battery charge increase by 10% without the charger connected when the battery charge was at that particular bad charge level! Now I've seen an Apple battery increase 1% maybe 2% before without the charger, but never 10%. Normal Apple testing will never detect an issue like this, nor will the Apple service diagnostics. A tech must carefully monitor the battery drain during a stress test to check whether the battery is draining at a consistent rate which Apple doesn't do and many AASPs are unlikely to do.
Keep in mind when running the laptop with each CPU core at 100% the battery may not increase its charge since most of the power will go to running the CPU although the battery charge should remain constant if no external devices are connected.