寝る(neru) and 眠る(nemuru) are different verbs. Different kanji in writing, own conjugations.
Neru tends to indicate more intentional sleep (arranging to go to sleep: deciding to retire to bed, to lie down etc), whereas nemuru is spontaneous sleep (falling asleep --- and not necessarily lying down).
"Nerarenakatta" has the possible interpretation of something like, "I couldn't sleep (because of no opportunity to get away from activity and lie down)" whereas "nemurenakatta" is "I couldn't fall asleep" (insomnia).
I think if you stayed up all night studying and so because of that you couldn't sleep, that's when you might best use "nerarenakatta". I couldn't sleep (because I needed to do something else with the time, not due to failure to fall asleep).
Neru tends to indicate more intentional sleep (arranging to go to sleep: deciding to retire to bed, to lie down etc), whereas nemuru is spontaneous sleep (falling asleep --- and not necessarily lying down).
"Nerarenakatta" has the possible interpretation of something like, "I couldn't sleep (because of no opportunity to get away from activity and lie down)" whereas "nemurenakatta" is "I couldn't fall asleep" (insomnia).
I think if you stayed up all night studying and so because of that you couldn't sleep, that's when you might best use "nerarenakatta". I couldn't sleep (because I needed to do something else with the time, not due to failure to fall asleep).