What's the temperature like where you are?
This could possibly be explained if your laptop got very cold and started messing with the battery, and then started warming up (when you started using it plugged in), at which point the battery started recovering.
Sometimes I know my 2018 battery was getting unhappy last winter, when it was probably getting down close to 0˚C. My old iPad used to shut down some cold winter nights, even with a full battery. Became a problem if I was relying on using it for an alarm.
I expect the slightly aged battery is causing this, which realistically shouldn't be happening at all above 0˚C, or even lower.
EDIT: To clarify, this was happening to me with all devices indoors, so there is a good chance the temperature never was falling below 5˚C. So it certainly shouldn't have been happening, but it did.