Rewire a ceiling fan, ceiling fan on, not controllable by switch
I think you have a hot-neutral reversal somewhere. You don't show it, but I'm going to assume that you have a ground wire in there somewhere. If you have a multimeter, the voltage between white and ground should be 0 (or almost 0, a couple of volts at most). If not, then you need to take apart all of the connections in the circuit and test each one to figure out where the reversal was introduced and fix it.