Bathroom fan/light wiring help
You believe the multiple neutrals are spare

It's real common for novices in electrical to see extra wires, and just assume they are spare wires waiting around for you. 

That is not the case.  It is quite rare for electricians to install "extra" wires.  Every wire has a job. 

Electricity flows in loops

Hot is available at the supply wire, and there's a second wire in the supply line - neutral.  Those ultimately go back to opposite sides of the supply transformer - that's half a loop. 

Electricity flowed out the hot wire, went through the switch, out the fan cable and on to the fan where it did the work, and then where?  Not the ground, that's for safety.  It came back on the fan cable's neutral wire.  Then did it just end in the box capped off?  No, the neutrals were connected, so it went onto the supply neutral wire, completing the loop. 

You attached the supply neutral to the switch so at least it would power up.  

... or not

As for the fan, power goes to it, tries to come back on the neutral, and can't... which raises the voltage on the fan's neutral wire to 120V, as voltage is simply backing up with nowhere to go.   Tell me you insulated it and capped it off. 

If you just left this "spare" neutral loose in the box, then it's a 120V time bomb. If the wire manages to short to either neutral or safety ground, the fan will power up momentarily, but the connection will be poor, causing a series arc fault.  If it shorts to ground, it also creates a ground fault, a particularly bad thing in a bathroom. 

Double especially if there is another problem with the ground, because that ground fault could electrify all the grounds between here and the problem. 

You wouldn't have expected a neutral to be hazardous (it's connected back to the panel, right? Oh wait...) Anyway, yeah. Electrical tends to be full of minefields. 



So.  The right answer is to rejoin the neutrals, and add the smart switch's neutral to that bundle of neutrals, so all are connected. 

Also, I would say that if you want to do any future electrical, I recommend getting a primer on the subject so you can get a well-rounded understanding of how things work.  A book on electrial that feels accessible to you is a good start.  You can't really google it; the subject is too broad.