Chances are you are nice and comfortable on the trainer and can shift easily. Out on the open road, you and your bike are dealing with a lot of other forces/conditions that you don't get into indoors.
Take the bike for an easy spin on a flat, smooth back road or empty parking lot and shift through the gears while concentrating on shifting smoothly. If it works in that case, just pay more attention to your shifting.