Brand new MBP waking/heating issue
One thing for sure: it shouldn't act like that. 

Beside that it'll be hard to say what was going on -  seems like it was overheating (was the fan running?) and didn't want to start working before cooling at least a bit. 

There might be a lot of reasons for that, but keep a close eye on your machine behaviour - should it happened again - definitely get it serviced since it's a brand new machine.