My best guess is that Your didn’t delete the running docker container, but you claim that you deleted the images. And it seems like you’d have gotten some other indication.
Or you’re using an external postgres rather than the one in the container?
Usually deleting /var/discourse/shared and doing a rebuild does the trick.