There is an option in ECR to use immutable repositories which is a best practice to use. Pushing an image with an existing tag gives you an error, which is expected.
However, this is not compatible with re-running builds. There should be an option in this pipe to ignore uploading an image if the tag already exists.
The only alternative is to tag the image with a unique tag for each build.