It could be the case that the private keys derived from your old wallet are uncompressed, whereas the private keys that the code above produced are compressed.
load_wallet() method gives you back some JSON, can you check and see what the compressed and uncompressed public key addresses are with this code?
Here’s an example with the private key
Python 2.7.14 (default, Dec 14 2017, 15:51:29)
[GCC 6.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import virtualchain
>>> virtualchain.lib.ecdsalib.ecdsa_private_key('a9557507705dd216633dc405333b1fcd855328ade314e9f2e22ce6fbc215e14901', compressed=True).public_key().address()
>>> virtualchain.lib.ecdsalib.ecdsa_private_key('a9557507705dd216633dc405333b1fcd855328ade314e9f2e22ce6fbc215e14901', compressed=False).public_key().address()
What is “interesting” is that the output addresses are the same ones generated when I run setup_wallet. Is this supposed to happen?
setup_wallet directive calls
load_wallet() internally to attempt to migrate it. What I suspect is happening is that somewhere along the line the private keys from your old wallet are being used to generate an uncompressed public key address (which will be different than the address of the compressed public key).