Using optical drive for boot
My first thought would be to try and resolve the initial issue (i.e. the fact your MBP is not recognising the main drive slot), as that's what is most likely causing your current problem as well.

However, since you seem happy to work off the optical drive, I would try the following:


First reset the NVRAM and SMC (in that order)1
Boot up from the optical drive slot
Go to Apple > System Preference > Startup Disk
Ensure that the current boot drive is selected
Exit System Preferences and Restart your MBP


Now test to see if that has made any difference.

1. Since you haven't provided details of your exact MBP model I've included links to Apple's instructions. Make sure you read these carefully so that you're following the correct steps for your MBP.