If it's just a one-time occurence, then I wouldn't worry. Software glitches can sometimes cause an app to drain the battery overnight. It happened to me occasionally. Once it was TuneIn, which I had used in the car with CarPlay and which, for some unknown reason, continued to work in the background for hours after getting out of the car. It hadn't done that before, and hasn't since. Another time it was Find My, which had a lot of overnight activity for no reason. Again, it hadn't done it before and hasn't done it since.
I doubt that a two year old battery is at the end of its life already. Close all open apps, restart the phone, and keep an eye on it. If it doesn't do it again, you're good.