The screws are usually quite long and engage lots of threads. Fan boxes usually have a long hollow/threaded insert swedged into the box.
I mounted my fans on Unistrut/Superstrut to make it fall exactly in the middle, could have easily bolted the boxes to one of the purlins, but then it would have not been centered

what you cannot see in the first pic is the ¼-20 bolts inside the box that screw up into channel nuts in the strut material. Then I put a heavy metal strap over the top of the strut and ran long ¼-20 bolts down thru the strap, thru the box, and thru the cover and the fan mounting bracket, using large thick washers and self locking nuts.
I made new 48 inch downrods from (brand new/old stock 1987 vintage) American made 3/4 water pipe I was given.
The fan also has a safety cable that is connected to the strut, and the strut is connected to the purlin flanges with ½-13 bolts and large washers both sides.
Charles