My MBP16 m2 Max 2023 has got the same issue on Sonoma.
I use a command to watch the power adapter status.
Save the following shell codes into a file named power.sh
#!/bin/sh
/usr/sbin/ioreg -r -bc AppleSmartBattery | /usr/bin/grep -i "AppleRawAdapterDetails"
then execute the following command to make power.sh executable:
chmod +x power.sh
then execute power.sh
./power.sh
For my MBP now, which the power adapter is connected to a usb-c hub and the hub is connected to the usb-c port of MBP.
The full power of the adapter is 140W, while power.sh outputs the following
"AppleRawAdapterDetails" = ({"IsWireless"=No,"AdapterID"=0,"AdapterVoltage"=20000,"FamilyCode"=18446744073172697098,"UsbHvcHvcIndex"=4,"Watts"=60,"UsbHvcMenu"=({"Index"=0,"MaxCurrent"=3000,"MaxVoltage"=5000},{"Index"=1,"MaxCurrent"=3000,"MaxVoltage"=9000},{"Index"=2,"MaxCurrent"=3000,"MaxVoltage"=12000},{"Index"=3,"MaxCurrent"=3000,"MaxVoltage"=15000},{"Index"=4,"MaxCurrent"=3000,"MaxVoltage"=20000}),"Current"=3000,"PMUConfiguration"=3000})
Obviously, the max power of my MBP is 140 Watts, and the current adapter just can provide 60 Watts. So if I run some software with heavy load on MBP, the battery drains.
However, things do not go such easy. Even when I connect the original power adapter with a mag-safe power cord, the battery drains slowly when the MBP is running.
When I click the battery icon on the status bar and select the menu item "charge the battery", it seems the battery stops drain and started to be charged.
I believe this is a bug of Sonoma. Hope apple solve it ASAP.