When the wallet auto refreshes after mining the last two blocks but before popping them, it will then try to use outputs which are not unlocked yet. This is really a wallet problem, which will be fixed later.