SSD boot drive does not work only on primary drive slot I have the following very strange problem with my 13″ early-2011 MacBook Pro.

The disk configuration is as follows:

Primary slot - FileVault 2 encrypted 120GB OCZ Vertex 3 SSD
Secondary slot - the original 500GB hard drive in a caddy

For a year the computer worked flawlessly, until yesterday.
When I got home from work, I opened the laptop and it was supposed to wake up. Instead, it showed only a one-color screen and wouldn't wake up. So I closed and opened the lid a couple of times (it worked before), hoping that it will wake up. When it didn't, I decided to power it down from the power button.

Then, when I turned it on, it wouldn't boot at all.

After the initial infarct thoughts of dead SSD, playing with all possible boot modes and stuff, in safe mode it showed that it is indefinitely waiting for a boot device.

So I switched the drives, the SSD went in to the caddy and the HDD went into the primary slot, an VOILA - it worked again! The good thing was that the SSD is alive (the last Time Machine backup was 1 month old, which was bad).

When I booted in restore mode I tried to unlock the encrypted SSD in order to repair it and its permissions, but could not. Did a search and found out that it should be because of problematic encryption.

Then, I decrypted the SSD successfully from within OSX, and tried to switch the drives back to the original configuration - the SSD in the primary and the HDD in the secondary slot.

To my big surprise, it does not work! There is some problem having the SSD in the primary slot.

The laptop is out of warranty, I need it badly and I live in a country with very expensive services, so I am trying to find out the problem without leaving it in the repair shop for days or weeks.

So, any thoughts on what could the problem be?
Is it definitely the Late-2011 model and not the early-2011 model? as the early-2011 model had an intermittent problem with interference on the hard drive flex cable. It would usually only cause problems when a 6G SSD is fitted. Because it is the boot drive you can find the interference can cause boot problems, sometimes locking up or beach balling (the coloured circle going around).
If this is the case, the Late-2011 hard drive flex cable resolved this problem, so a replacement cable should sort it... but if its not working in the optical caddy either, then something else is going on (unless you have the 2.3GHz i5 Early-2011 machine. in which case, thats the only 2011 machine with a 3G SATA port in the optical bay, so your 6G drive wouldn't work in it). Can you confirm the generation? or the serial number will help identify the exact range and processor speed.

you can sometime fix the interference problem by insulating the flex cable a bit... or for testing the machine, connect your SSD to the hard drive flex cable, but instead of fitting it to the machine, leave the drive sitting on the side out of the casing unit so its away from the cable itself, as it will eliminate most of the direct interference issues. 

I hope this helps. if you check your machine generation just let me know and i will see if i can help any further