I had exactly the same issue with my Cozmo. It was shutting off after 2-3-5 minutes of use with no warnings and no matter how long it was sitting on charger. I was blaming myself since my Cozmo fell off the table.
I fixed the issue by re-welding contacts for the battery. Even if it looks well connected, you might give it a try. You will have to take the whole Cozmo apart and welding on battery should be done with extra care.
After re-welding contacts my Cozmo works perfectly fine, lasts until the battery is drained.