These newer Macs have some very odd quirks. Sometimes it is just necessary to connect the charger to power on a recent Apple laptop. Normally the only time you need to connect a charger is when the battery is completely discharged (never a good idea to let this happen), or after the battery was disconnected & reconnected to the Logic Board (should not be a concern for the average user). If neither of these situations apply, then it may mean the battery has a problem or it is just a weird bug with the system.
Check the battery condition by Option-clicking on the battery icon on the menubar. As long as the condition is not "Service Battery", the battery is most likely Ok. With macOS Catalina & Big Sur you may see "Service Recommended", but this condition is way too vague to know what it means (may mean a bad battery or it may mean the battery won't run as long).
Run the Apple Diagnostics to see if any hardware issues are noted.
Try an SMC Reset.