This is a late 2012 mac mini. I recently replaced the fan, which was making a lot of noise. The replacement is not from apple. Everything works fine, and the system is quiet. But I ran an Apple diagnostics which gives me the following error: 4MOT/1/40000002-Exhaust-0. Is this because the fan has not been installed properly or it is Daignostics not liking a non-Apple product? Many thanks for your advice
The "MOT" in the error code indicates, as you may have guessed, trouble with a motor of some kind.
It would be logical to assume it points to the fan you replaced.
I wouldn't expect it to be caught during a hardware test, although these fans are controlled by a chip that precisely modulates power, and could detect when the motor isn't acting as expected according to the input, which I guess could be described as "diagnostics not liking a non-Apple product."
Regardless, it does mean at the very least that the replacement part you used isn't identical to the factory part. Is the fan spinning at all? You say the system is fine, but also quiet. Could this be because it was installed incorrectly and isn't even functioning? I can't imagine how you could install the fan incorrectly, but if you don't hear it spinning at all, maybe you should take another look to see if everything is connected, and you didn't destroy the fan connector, which is too easy to do.
Where did you buy the part, and was it listed as compatible with the model you have? Even if it is a third-party part, I find it hard to believe that AHT would detect it as malfunctioning if it had the right specs and was actually connected to the board.