This issue follows the discussion from here.
Core currently does an exact match to check if it should omit the change output when creating a transaction. However the correct logic should be to have a little of leeway, donating extra money to miners if required.
(This is because creating a change output itself isn't free, you need to pay the extra bytes in the transaction, and in the future source that change output at least paying relayfee).
So instead of an exact match against amount == target it should check if it's amount >= target && amount < target + sizeof(a_change_output) * fee_rate + sizeof(sourcing_that_change) * relayFee).
This has the benefit of improving coin selection, but most importantly it will hugely improve privacy for bitcoin users as it'll break a lot of the wallet clustering logic that identifies change outputs.