Don't waste a second on worrying about "what gives?"
Initiate a partial chargeback for the $20, noting that the fee was $30, that UA acknowledged that the fee was charged in error and then only processed a refund for $10.
UA won't bother to research the issue and, if it did, would acknowledge fault. You will have a temporary credit in short order and it will become permanent when the time for a response passes.
Even at minimum wage, it's not worth the time you will spend on the phone and even then you will never have a good answer as to what happened. People make mistakes.