Assuming that things work on Mallorca as on mainland, the 3% is a withholding tax.
My understanding is that you should now make a proper return which shows your actual gain after expenses and allowances and this will be taxed at 18%. if that works out at less than you have paid then you should get a refund, if it works out as more then you owe them more. On this basis and looking at the figures they owe you about half of what you have paid or even less if you had estate agents and lawyers fees to offset.
If on the other hand you are a resident and you are rolling over the full €350,000 into a new purchase of a principal residence in the next two years you will not pay anything at all and you should get back all the tax paid.
If I am wrong I am sure Maria will tell us!