The Phantom Capital Gain Tax from the Sale of a Property

Anecdote: Another Encounter with the Oracle

27 / Oct

A few months ago, I published an anecdote about how to respond to oracles and anonymity: https://lexforis.com/anecdote-how-to-deal-with-oracles-and-anonymity. It was a case in which someone used ChatGPT to try to disprove my legal reasoning.This time, the situation was different: clients I had advised began to doubt after consulting ChatGPT and hearing from various professionals who confirmed the opposite of my recommendation. I will explain.

A few months earlier, I was consulted by these clients, who are residing in Spain, about whether they needed to pay capital gains tax in their Spanish income tax return (IRPF) for the sale of a property they owned in Amsterdam. These clients had already done some research and spoken to several professionals; all of whom told them they did need to pay the tax. My response was the opposite, and I gave them my reasoning based on international tax treaties.

A month later, they reached out again, visibly worried. Once again, other advisors had told them that the Spanish Tax Agency (Hacienda) considers such gains as taxable income in Spain. But this time, they had also consulted the “digital fiscal oracle” , a well-trained assistant, but not infallible, whose answer was firm:

“As a tax resident in Spain, you are taxed on your worldwide income. Spain can tax the gain, and you then apply a deduction for the amount paid abroad.”

But that didn’t match what I’ve seen over the years. If the property is in the Netherlands and there’s a double taxation treaty in place, Spain should not touch that gain, at least not to collect tax.

When something doesn’t fit in international tax matters, it cannot be ignored.

Worried, not only for the client, but in case I had missed some recent law or ruling, I went back to the sources: the Spain–Netherlands tax treaty, the IRPF law, the tax return forms, TEAC rulings, and Supreme Court decisions.

And there it was:

Article 13 of the treaty states that gains from immovable property “may be taxed in the State in which the property is situated.”

Even though it may sound ambiguous, this is not a shared right; it’s an exclusive attribution to the country where the property is located.

In addition, the Spanish Tax Agency has consistently applied this for years:
✅ That gain is not included in the IRPF tax base.
✅ It is declared only for the purpose of calculating the average tax rate, if there are other taxable incomes.

The Supreme Court has also made it clear: When a treaty gives one country the right to tax a specific type of income, the other country must refrain. And if an exemption with progression is foreseen, it applies. But a double payment is never imposed.

With all the data verified and more convinced than ever of my view, I went back into the Oracle, ChatGPT, and posed the same question again. And the oracle, with a mix of elegance and humility, acknowledged its error, revised the answer, and corrected it. That’s how good tools should work: they learn. Because even the best-trained AI can slip when it lacks full context. That’s why human judgment, critical, informed, and verified remains essential.

And thus ended the story of the “phantom tax” that seemed to be coming… but never arrived.

Roeland van Passel