The alum water pump assy was new from the box when painted. Paint flaked off within the first few years. Not so with the cast iron block and heads.
New parts are almost always coated with an oil of some sort. There is no way of telling how long they will sit on a shelf. Last thing you want is to open up your brand new part and find it rusted or corroded ! .
Bottom line , paint doesn't stick for no reason. You painted both parts with the same paint, I am assuming at the same time. Yes one may be aluminum and the other iron but paint ( engine paint for sure ) should stick to both if they are clean.
I paint for a living , it can be a very frustrating process sometimes. We recently had a wave of brand new Honda's come threw the shop that had sat out dealerships back lot for months, due to Covid lockdowns. They got covered in tree sap that etched itself into the clear coat. They needed to be sanded down and repainted.
The catch , in their ultimate wisdom the dealership decides that they need to " detail" the cars before they come to the body shop. That means silicon / teflon spray for tires and trim pieces. They of course tried to remove some of the spots as well, or hide them best they could with waxes, glazes.
Needless to say , that stuff is a HUGE PITA to remove. Our normal prepping process , and cleaners did not do the job. 2 cars were done that were covered in fish-eyes before we got wax and grease remover with a more aggressive formula, and then followed by our regular products.
Nothing boils my blood more than standing in a booth after you laid down the clear coat, and watch imperfections literally just form right in front of you, and there isnt' a damn thing you can do about it !!!
I think what would be more helpful in your case is tell us maybe what you use to clean everything down with before painting.