It's called "pickling"...
The impeller could have failed for several reasons, Run dry, improperly installed, picked up a plastic bag, they never actually changed it etc....
Anyway, when the engine got hot and shut off, the steam collapsed and sucked water in through the exhaust... Silly common.
You need to inspect the exhaust hoses and flapper valves, get every single piece of the old impeller out, check the oil cooler and thermostat housing, everything, that rubber will be everywhere.
Clean it up, new gaskets, put it back together, it's likely fine... For comfort sake, have the heads mag checked my a machine shop...
GT