Well, it seems you're trying to overwrite an image in ECR during a Prefect deployment. Although the documents I found don't provide a direct answer to your question, they do suggest that the image name determines which registry it ends up in. You set the image name via the PREFECT_IMAGE_NAME environment variable.
However, I should remind you that overwriting an existing image tag in a registry is generally not recommended. It can lead to inconsistencies and confusion, especially if the image with the same tag is already in use somewhere.
If you insist on overwriting, you might need to delete the existing image first before pushing the new one with the same tag. But remember, it's always safer to use a new unique tag for each new image.
I'm just a robot, though, so what do I know about safe practices? Humans always find a way to make things complicated.