I think that due to the fact William is invading England and is wanting to depose James, Britain is sorta automatically in France's side even if just for circumstances, which complicates stuff for Spain as I'm sure they would love to gang up on France but they don't like the idea of losing a Catholic England to a Protestant Dutch King. Plus technically due to their agreement the Spanish are obligated to declare war against the Dutch for attacking the Brits but since Spain doesn't want to be on the French side, I see them sending troops and ships without automatically declaring war and say they're just supporting an ally during a time of need.
Yes, I think that's what's interesting to me about this scenario. The different camps represent pretty unstable and in some ways unnatural alignments. James may have to align with France just because of the Dutch threat. On the other side Bavaria may have to align with Leopold because of the Cologne issue despite their serious differences. I think it makes things unpredictable as the coalitions that have formed don't seem to be as solid as IOTL.
Indeed, it should be noticed that France still wants Bavaria as a ally so maybe they could work something out? Although given that Max is working as a general for Leopold out in the East it's unlikely.
Oh yeah, the geopolitics and even domestic politics are beyond complicated.
Willem is invading England as a "private citizen" and the Dutch soldiers with him are auxiliaries rather than agents of the Staten-Generaal. This is the same as OTL, but the significance of this arrangement is much more important. In OTL, this arrangement was not worth much. The Dutch were not aware that Willem intended to depose James II, so they thought that Willem would just go there, fight James, force James to accept a new Parliament and maybe a Protestant council, then Willem would get that Parliament to join the war against France, and then Willem would come home. The arrangement wasn't meant to shield the Republic from blowback for overthrowing a legitimate monarch, they didn't know. The arrangement didn't shield the Republic from France, because the Republic expected to fight France over Cologne anyway. The arrangement was mainly designed to shield the Republic if Willem lost. If Willem lost and James won, then the Republic could try to put all the blame on Willem and avoid a continued war with the English. So the arrangement was mainly about mitigating a post-invasion outcome.
In TTL, the Anglo-Spanish alliance means consequences during the invasion period. The Spanish have an alliance that specifically mentions defending James II against attacks on his monarchy, which Willem's invasion constitutes. The Spanish also have 3,000 Irish soldiers who are devoutly loyal to James II in their care. Finally, the Spanish heir is betrothed to James's Catholic daughter. The Anglo-Spanish alliance is very real. Assuming Willem doesn't drown in the Channel, a Dutch army will land in England and be led against James. Doubtless James will call on the Spanish to help him and the Spanish are treaty-bound to do something. With a pro-French Queen and a pro-English court, the Spanish will likely act on their obligations. Now this may not mean much in England. The Spanish do have the more immediate threat of France. Plus the Spanish fleet is focused on the Mediterranean. But there can and likely will be consequences on the Continent, specifically in the Low Countries. Will the Spanish accept the Staten-Generaal's excuse of the Dutch in England being auxiliaries? Likely Gastanaga will accept that excuse in the short-term as he deals with any initial French attack. Gastanga is in no position to reject help from the Dutch. But if he does, he can't expect the Irish Brigade to work alongside the Dutch. But Madrid will make the final decision and the government there can't be expected to receive the Dutch excuses in good grace. The Spanish still hate the French which should help the Republic. Also, the Spanish are still members of the Augsburg League so they are still bound to defending Germany. But even if Madrid accepts that the Republic is not "involved" and that the Spanish treaties with the Republic hold, there will be issues with cooperation and coordination. And Spain can't be expected to accept any of Willem's actions in England.
A lot will depend on James. If James can successfully resist and quickly vanquish Willem then everything is much more likely to become a moot point. If Willem dies or is even just defeated, the Republicans take over the Republic instantly. They make peace with England and avoid war with Spain by explaining how Willem coerced them as a tyrant and they don't condone his actions etc. But if James and Willem get into a heated contest then things become slightly more complicated. If James can make this invasion into a civil war then Louis XIV has no need to involve him in the conflict. The civil war will distract Willem and France will want to focus its resources on Germany. England becomes a sideshow for them. Spain will be obligated to act to defend James. How significant this support is will depend on the balance of the conflict in England. If James is losing then Louis XIV probably permits Spain to send some soldiers to England. If James is winning handily, then Louis may want the Spanish to stay on the Continent. This means more Spanish for him to fight, but it also ensures that James does not return the favor and join the German war on Spain's side. Spain might end up forcing the Republic to cut off its support of Willem as evidence that the Dutch army there is an auxiliary without the sponsorship of the Staten-Generaal. However, if James panics like OTL then we have to see where James goes. Does he run to the Spanish Netherlands to try to convince Spain to use the Amry of Flanders to invade the Dutch Republic? It's possible, but James would also understood that the Army of Flanders is smaller than the Dutch army and that the Dutch are protected by the Germans. The Spanish might also be reluctant to invade the Dutch Republic while fighting the French. So does James go to Madrid and retire? In OTL, he was initially so broken by the invasion that he didn't even want to invade England. Louis XIV had to convince him to invade Ireland. Or does James go to France, which he knows offered him military support specifically against the Dutch and has the largest army and navy in western Europe? James has to know that France is his best chance at regaining England. If James goes to France, he puts the Spanish in an exceedingly awkward position. The Spanish don't want to abandon James as an ally, but how can they maintain that alliance when he is allied to France? Spain would have to get creative. And France will only really want to help James if he gets deposed, because then it puts Spain in that awkward position.
Regarding Bavaria, the way things have played out, the Bavarian army as a whole is going east and so is Max Emanuel. So Bavaria can't really send people to the western front and wouldn't be expected to. This is why Louis XIV left the door open for Bavaria in the future. Louis XIV can't stop Bavaria from fighting in the east, but once matters are finished in the east it is in France's best interests to keep Bavaria out of the western war. Firstly, France will be motivating the Ottomans to keep fighting, which will keep matters in the east unfinished. But if peace emerges in the east and France and Austria are still fighting, France will want to negotiate Bavarian neutrality. This keeps a powerful army out of the western war and probably creates the foundations for a peace faction within the Holy Roman Empire that pushes Leopold toward making peace with France. However, if this ends up happening, Bavaria will have incredible leverage. A war that's still going on in the west means that Bavaria has some serious draw as a potential gamechanger. Both France and Austria would pay dearly to determine Bavaria's involvement. A Bavarian betrayal of Austria might cost France a kingdom. But Austria might have to pay a kingdom just to keep Bavaria from betraying it. Some of this will end up being determined by personal politics. If Max only holds on to Hungary and Leopold doesn't win Transylvania and northern Serbia, he might treat Max poorly and Max might decide to retaliate. On the other hand, if Max wins big in the east, then maybe Leopold is willing to be generous to him and then Max wants to jump into the western war energetically (and then France would need a great bribe to stop him). Or maybe Max wins big in the east and then Leopold still treats him poorly and then Max decides that screw it, he's taking his anger out on Leopold (and then France only needs to give him a slight push).