The new test Docker image has a newer gnupg which does not behave the same way, handling invalid passwords. This type of error is simulated using an ICP error in the pinentry protocol.
This is a program which adheres to the pinentry protocol. It always provides the password located in /etc/mock-password.