The UK relationships with the channel islands are within EU law "The formal relationship between the Channel Islands and the EU is enshrined in Protocol 3 of the UK’s 1972 Accession Treaty, and confirmed in what is now Article 355 (5) (c) of the EU Treaties."

In other words. It is an exception. Thus the rule has at least one exception.

It is not a deal where a Govt. places an order with a company in another country for goods or services.

Er no, the purchaser was a private company, maybe owned by the Saudi government or by individual members of the Saudi elite, but structured as a private company nevertheless. The company who made the trains or did the construction or whatever was a Spanish company, also a private company. The Spanish King was not an employee of said company. He went there to facilitate a trade deal between two private companies, one of which was in his country and thus in his responsibility as a head of state. He was not as a representative of the company. Therefore the Spanish state was involved in brokering or supporting a trade deal that was advantageous to a Spanish company. No?

If it were true that the EU has a monopoly on dealing with external trade negotiations of any type, then that would have been Junker's job, no?