Yes this should be corrected and it would be good to have the wiring and all the circuit connections inspected as well.
Attic wiring tips.
Insert the end of the 12 2 wire into the fans junction box.
There should be no excess wire or ends left in the attic.
Strip away about 6 inches of outer insulation and 1 2 inch of individual insulation from the end of each wire.
Since insulation is combustible you must install face plates on all attic junction boxes to prevent contact between bare wires and insulation materials.
For the horizontal portion of the cable run this can involve drilling holes in the joists where the cable will pass.
Location of power supply and switch find a live receptacle for the power source.
How id do it if you put your cables to the edge where the apex of the roof meet the ceiling so you basically end up with your wireing loom at the edge of your attic then clip your cables along the ceiling joists 50mm from the plaster board then its clear of insulation and if you need to lay a floor you can but do try to avoide drilling hole through the joists as you will not meet the requirements as youll be less than 50mm from each each edge if the ceiling joists are 75mm.
In both exposed and concealed locations where a cable or raceway type wiring method is installed parallel to framing members such as joists rafters or studs or is installed parallel to furring.
Step 8 locate the wires at the sites where you fed them to from the attic and complete your connections first then secure or conceal the rest of the wire.
Electrical wire for the home.
The following links will assist you with your electrical question.
Electrical wire electrical wire for the home.
The attic wiring should be protected and secured to ceiling joists or other wood structural supports.
When adding or replacing wiring in finished walls most electricians will attempt to make the horizontal portion of the cable run in the unfinished attic or basement crawlspace areas looping the cable down or up through the wall cavity across the floor or ceiling joists then vertically through another stud cavity to the next wall box opening.
The process of wiring an attic fan involves the power source and switch location wiring connections to the switch and wiring connections to the fan.
Here are 3 tips to help.
Junction box mounting locations there are two options for mounting boxes that are wholly contained within the attic.