Many beginners express disappointment and exasperation at the fact that they can do their nagekomi well but none of their techniques work in randori. They can't understand why.

The reasons are manifold. In nagekomi:
a) Uke gives you the grip you want and doesn't try to break it.
b) Uke stands square in front of you, making it easier for you to enter into the technique as well as to lift uke up.
c) Uke stands still and doesn't move about.
d) Uke doesn't resist when you enter into the technique and start to lift.
e) Uke doesn't try to counter you.

All these things above make it easy for you to do a nice, if not perfect, nagekomi. It will look beautiful. People will praise you for doing such a nice throw in practice. But when you try to do that very same throw in randori, you'll find all those five factors have suddenly changed.

Uke is denying you the grip you want, and if you get a grip, uke will break it. Uke will not stand square but either in a kenka-yotsu (opposite stance) or ai-yotsu (similar stance) situation. Uke will be constantly moving about, making it hard for you to settle down for a throw. And if you do launch an attack, uke will actively resist and even counter you if possible.

That is why it's so hard to do a technique in randori.

So, how do you bridge that gap? The natural way to do it is to simply do a lot of randori and learn through trial and error. But that takes a lot of time. If you want to accelerate the process, you need to do the following things:

a) Work on your gripping strategy so that you can get the grip you want. You need to have ways to combat uke's gripping tactics, which are meant specifically to stop you from getting your grip. You need to overcome that and be better at gripping tha your opponent.
b) If uke does not have a stance you like, to get into the positioning that you prefer you can move yourself, move uke, or do both (move yourself while moving uke, at the same time).
c) A superior grip will allow you to lock uke down, a split second, so you can enter into your throw. In randori, you won't have more than a split second to enter into your throw.
d) You need to learn all the possible defences against your favorite throw. Once you have identified the defences, you can start to develop precursors to set uke up for the throw. These precursors will help you overcome strong defences.  
e) You need to also learn all the possible counters against your favorite throw. If you don't even know what the counters are in the first place, how can you devise ways to overcome them?

As you can see, learning the mechanics of the throw well, is only the tip of the iceberg. You've got many other factors to contend with before you can make the technique work against a resisting opponent in randori.