State tax filing

CA and VA seem to have a weird reciprocity, where VA residents pay the full amount to VA and then get a credit back from CA.  I worked the VA taxes both with and without the house sale to find a delta of about $17000, so I entered that as the "tax paid to Virginia" in CA's section for other-state-tax credits.  This seems to have knocked the CA tax (on just the house) down from $25000 to $18000 - so the total tax on the house sale is now $35000 - substantially more than if I were paying it to either state alone.  This doesn't seem right - I feel like I'm still probably missing something?