The most important thing with wire nuts is to get the ends of the wires very close to the same place (same length of engagement in the nut). Twist the nut on until the insulated part of the wires outside the nut starts to twist together. Then it is done.
Have you looked at the actual voltage at the ceiling fan? I'd hook a meter up and watch it. Maybe it's just right at the limit to run the fan and dips down momentarily and shuts it off. If you see the voltage issue work yourself backwards towards the panel. Otherwise you're just guessing.