You have to give details on your setup. It can be a PSU problem: overheating or not enough juice coming to it, or from it. Or simply the ignition is cutting it hard, or windows has no time to shut down and something is preventing it. Why the screen goes black?
I had a faulty SATA cable that gave me a lot of headache and it had those detecting problems you describe. So lots of things are possible here.