Why does my MacBook Pro suddenly die instead of remaining in sleep mode?
You may need to recalibrate for the new battery. Use the computer until you get the warning message. Then, shut down and plug it in. Let it charge fully before you turn it back on. Doing this will allow the system to calibrate for the new battery so that it can more accurately tell how much charge is remaining, which could help if it thinks the battery will last longer than it does.