|Is this your computer?|
I have never heard of a computer shutting down if the password is inputted incorrectly on the first try, but I suppose it can be tweaked to do so.
If it is your computer, it could be rapidly overheating before you get to that point. or the power supply is failing.
Then again, it may not be fully loaded and encountered an error and shut down.
There is an option to shut down on error.
I am sure that if you supply more information, a quantified and qualified answer can be given.
Laptop, desktop,make , model, age ect................