I have recently bought an SSD (Crucial MX500) and an USB enclosure (EE25-F6B). I wanted to use it instead of my internal drive in iMac(Late 2012). I tried installing macOS Mojave on it from a usb stick, but the instalation always failed when it was trying to convert the drive to APFS. So I tried El Capitan but the installation crashed everytime when it showed 2 minutes remaining. So I connected it to MacBook (2016) to see if it was faulty. It successfully installed and I was able to boot from it. But when I connected it back to the iMac, it didnt show up in the boot menu. But when I boot from my internal drive I can see it in the finder. I also tried booting from it on MBA and it worked. I have tried reseting SMC and NVRAM but it didnt help.