MacBook cooler fan ripped wires
The plastic connector is probably broken given that they were, as you describe, ripped from the connector.  There are very tiny detente molded into the connector and these are probably broken meaning the wire will no longer be secure.  This can lead to intermittent connection problems.

Spend the few dollars and get a new fan; it’s extremely inexpensive.