I found the bug. (err... more like a good-intention feature gone wrong)
https://github.com/spesmilo/electrum/blob/f92b483942d3f8ee51506e0436d9b524db33a336/lib/wallet.py#L1142The change selection method checks the first input, and if account == -1 (aka if the input is from imported keys) then it sets the change address as the address of the first input.
As your first input was from an imported address, it will send the change to your first input's imported address.
https://github.com/spesmilo/electrum/blob/master/lib/wallet.py#L602It looks like this is how it still works with the current development HEAD as well.
My two cents: I think changing
if not self.use_change or account == -1:
to
would be a good fix... as even if the input is from an imported key, if the user has change enabled, it shouldn't matter.
I assume this feature was created with this idea in mind: "If the user imports a paper wallet into Electrum, then uses Electrum to send, then deletes Electrum... we want to make sure their paper wallet still has the change."
Another way to prevent your issue would be to add a loop that continues to check inputs as long as the inputs are from imported keys... if it finds even one input from a non-imported address, it should assume the user would like to follow the self.use_change option (the option you have set in the preferences)
If you have Electrum installed (using an installer) or are building it from source. Make the change I mentioned in "My two cents"... the line I mention is Line 1142 in the /lib/wallet.py file