Chosen Solution

I recently bought a second hand mid 2011 27” iMac. Being handy with computers, I felt comfortable buying this without knowing if it worked because it was a killer price at under $50. I have replaced the hard drive and ram and the machine successfully boots up when the LCD is in place/plugged in and it is laying flat on my table. The moment I move the computer to the vertical position, though, it immediately shuts off. I can get the machine to turn on when it is positioned upright only when the LCD is not in the casing. I can also get the machine to function perfectly when it is flat and the LCD is plugged in. To me this seems like it is a pinched wire or pressure point but I’m not sure. I have run the Apple Hardware Test and it comes back with no errors. Any help?

Take a DVM and measure the voltage between the case and the display frame making sure the two are not touching are you measuring a voltage?