bitcoin-wallet create exits with status 0 even when the wallet couldn't be created:
$ bitcoin-wallet -regtest -wallet=w1 create # first time, ok
$ bitcoin-wallet -regtest -wallet=w1 create
Failed to create database path '.../regtest/wallets/w1'. Database already exists.
$ echo $?
0
In ExecuteWalletToolFunc the create branch only does something when MakeWallet succeeds and then falls through to return true. The other commands (info, dump, createfromdump) all return false on failure. So scripts that check the exit code think the wallet was created.
This returns false when MakeWallet fails, the same way info does. The added check in tool_wallet.py runs create on the existing wallet foo and expects exit code 1. It fails on master (not(0 == 1)) and passes with the fix.