Which fan? Did you remove the fan and heat sink from top of CPU when you cleaned inside?  It's also possible the thermal paste between CPU and heat sink just dried out so CPU overheats rapidly and the PC shuts off to prevent a total melt-down. Lots of youtubes about how to apply a thin, fresh layer of thermal paste. Don't remove CPU from its socket but gently clean top of CPU and bottom of heat sink with isopropyl (rubbing) alcohol to remove old paste. Be careful not to drip the alcohol on plastic surfaces etc and wear disposable gloves and eye protection. And also a good idea to replace the motherboard battery when you're done applying fresh thermal paste. It's a CR2032 3-volt lithium coin cell battery, ~$2.
Dell Dimension E510 Boot/Fan Problem  Back in November of 21 I decided to take apart and clean my 16 year old Dell Dimension E510 pc. Once I boot it up, the fans rev up and shuts off the system, the 2nd time I tried to boot it, the fans rev up so loudly and shuts off 2 seconds later. Can someone help me?
Dimension E510, boot, fan issue