Some people have claimed that there are solutions that fix the charging problem including:
"pmset restoredefaults" - use this command in terminal (may need to precede the command with sudo).
OnyX - third party software, use maintenance / run tasks to verify/rebuild/clean/etc.
Unfortunately, these "fixes" do not solve the problem for many people including me. With OnyX, some people claim that the problem went away for a while but the fix was not permanent. For some, even completely re-installing OsX did not fix the problem (not sure if 12.4 was re-installed rather than downgrading to 12.3).
discussions.apple.com
--
For me, the problem has gotten worse - lately I had to reboot every day or more than once a day. After OnyX, the problem returned within an hour without switching power source. Beforehand, I thought that switching between usb-c charging and magsafe charging was causing the problem - I have many power adapters at home and work (all made by Apple - one 140W, two 67W, and one 20W, which has become less reliable recently. USB-c cables are of third party).
p.s. OnyX did solve one problem for me - my AlDente now launches upon rebooting as intended via preferences. Beforehand, I had to manually launch every time after rebooting because my intended settings did not work.
Interestingly we bought three of the same spec laptops at the exact same time, only one of the three suffers from this issue, and yet all three have the same hardware and OS. I'm beginning to suspect I will need to send the faulty unit off for repairs of some kind.
Maybe I should ask for a replacement 16" laptop (MacBookPro18,1) without this bug.