Chosen Solution

Hello, I have a problem with my 2011 Mac Mini, High Sierra. When I use my drive as an internal drive, my Mac needs to reboot multiple times (1-3 mostly), but when I use the same drive and use it as an external via USB it boots just once. Multiple boot-ups only happen from a cold boot up. Once it goes to the login screen and I log in, turn in off, and then on again, it boot ups normally. I have reset pram, SMC, and all that stuff. I reinstalled my os multiple times now. Now I will try to install it fresh from the bootable drive. Also, I have swapped the flex cable from the original to a replacement one from aliexpress. I do not have the original one anymore, so I cannot test if it is the problem. I would really appreciate some help with this matter as I want to sell it but I do not want it to fail a new buyer. Cheers!

You likely have a worn or damaged cable. Follow this guide Mac mini Mid 2011 Hard Drive Cable Replacement to get the drive out of the lower bay. If you have a dual drive and the boot drive is in the upper bay follow this guide Installing Mac mini Mid 2011 Dual Hard Drive Kit Mac Mini Lower Flex Cable HD/SSD, Apple P/N 076-1390 (marked 821-1346-A)Mac Mini Upper Flex Cable HD/SSD, Apple P/N 076-1391 (marked 821-1347-A)