Yes, sounds like it's probably a hardware problem to me (just wanted to make sure the advanced power settings were not set to shutdown at 20% which is pretty unlikely, but you may want to make sure), but if you set your low battery notification to remind you to plug-in the AC adapter you when your battery gets down to 30%, etc., it can hopefully help you work-around the issue and avoid any unexpected shutdowns (unless the problem gets worse?)? Below is a a screenshot.
Also check the critical battery level (notification), critical battery action, and related battery settings to make sure they look okay and confirm it appears to be a hardware issue.
Don't expect this to be any different, but you might also try draining the battery in safe mode to make sure the same thing happens (and confirm again it points to a hardware issue).
Sorry, this probably doesn't solve the problem of the battery shutting down at 20%, so you may not want to pay much attention to it.