MacBook Air M2 suddenly conked out when using it
I was using my 13in MacBook Air M2 256gb in a cafe with 100% battery charge. My friend's iPhone 13 battery was low so I offered for him to connect to my MacBook through the USB-C port so he can charge. A few minutes later, my MacBook suddenly died and didn't want to turn on. I tried using the force restart guides from the Apple site but to no avail. As soon as I got home, I plugged my charger in and it turned on showing a 92% charge level, but my MacBook died again on its own a few minutes after. I tried turning it on again while it was attached to the charger and it worked. Right after, I removed the charger to check what would happen and it just died as though it's relying solely on the charger for it to work. The battery charge even suddenly said it was at 1%, literally not more than a minute since it said that it has 92%. I checked the settings and the "service recommended" prompt can be seen when you check out the battery settings page. It doesn't even show a "maximum capacity" level anymore. This shouldn't be related at all to charging an iPhone with a MacBook since I do it all the time, even with my older MacBook and experienced no problem whatsoever.
I am literally dumbfounded because I've had my 13in MacBook Air M2 since Jan 2023 and it has been used pretty lightly. I don't use any heavy programs and I also have a desktop at home so it's not really used much. When I don't plan on using it, I even charge/discharge it to 50% and make sure it's kept in a cool, dry place. As of last checking, it still even had about 95% battery health. This is pretty disappointing too considering I've been using Apple products for over 11 years. I plan to have it checked out by an Authorized Apple Service Center in a few days but if anyone has a comment on what may have happened with my MacBook, I'd really appreciate it.
MacBook Air, macOS 14.4