Working remotely from Spain

Travelling to another country for a valid reason like client visits, interoffice visits etc...this is normal business. But if a person voluntarily works from another tax jurisdiction for their own personal reasons then it is a different scenario...For instance I can visit my colleagues for work purposes in one country. That same country, I am not allowed to just travel to for my own reasons and work in at all, despite being legally allowed to work there under EU law. Even though it is the same country and the same legal entities the purpose is different and the tax treatment will be different. And for most other countries the max I can do this for is 20 days. Companies are just trying to protect themselves from tax/compliance expense due to employee activity which is not business related. In the same way I am not allowed to claim any expenses if it is me who chooses to travel, the company does not want to be out of pocket.
 
You are quite right, they can't know for certain how long you have spent in Spain if you enter Spain and and then go back to Ireland via another Schengen country. What they will know in future is your entry date into Spain (assuming you fly into Spain from Ireland) and then your departure date from the Schengen area (what ever country that might be). If thats over 183 days they may flag you for investigation.

Given how tax authorities usually behave, they could then just say they think you are tax resident in Spain and you have to prove otherwise. To be honest , I don't see this happening anytime soon and any tax advisor I have talked to in Canary Island says there are much bigger fish to fry as regards all the non-EU (i.e British) citizens who overstay not to mention work illegally.

Obviously for citizens of schengen area countries this won't apply becasue there will be no record of your movements.
 
Eg I spent the first 2 months of 2024 in Azerbaijan. At times during testing and deployment
That's very interesting, I'm presuming the Russian oil and gas industry is now suffering heavily due to lack of western expertise due to sanctions. Putin never understood how dependent russia was on it