After importing a dumpfile, the keypool size is 0 (zero)
running keypoolrefill results in error
keypoolrefill 10 error code: -4 error message: Error refreshing keypool.
A workaround
use the upgradewallet command
It should respond with wallet is already latest version
follow this with
keypoolrefill
And it should correctly set the keypool