I don't think it is worth trying to find what went wrong. Maybe it was mistreated before you got it. If this is the only rust, I would just replace it.
Maybe if it was at the top and water dripped on it from the supply connector but that doesn't look like it happened there. Take the cover off and look at it.