Might it be that the ai is here capable to take the monthly trade deals into account, but some players are not?
Certainly.
Ai in general is better with detail that are individually simple.
.... Ok, this sounds wrong.
What people often do is to some extent antropomorphise AI. AI isn't a fool or a human. It is a set of pattern-matching code, executing some actions in response to conditions. Nothing more. Since the code is executed by usually fast computer, AI has excellent reaction time, and since it is executed by a number crunching machine, AI can be programmed to match against fairly complex criteria. For example, calculating optimal distribution of pops to get maximum resource outcome is fairly trivial, if the AI devs actually bothered with it (but there might be valid reasons to bother with something else instead)
The problems AI always face are two-fold
- It cannot plan. If you see AI planning something, you are sadly mistaken: it simply was coded to react this way.
- It is set in its ways, and the target criteria a set by devs, who might have limited perspective on situations
These flaws were what devs of chess-playing AIs fought their entire existence. When computer and human are going play chess, the first thing human does is to make research on the strong and weak sides of the AI and then plan to exploit it. Since chess is a game with very wide decision tree, the devs always had to cut off many branches from considerations and usually used non-adaptive estimation functions to judge what resulting position is better. And this bitten them in the ass again and again.
I suspect that the current Stellaris AI is a simple rule-based code with elements of RNG-driven variations, that recognizes the patterns it was set to recognize and executes corresponding actions, with no estimation of outcomes. Doing something more complex would take a LOT of time and is not worth it until game rules are set in stone. Making the game friendlier to such AI is simple: shift model so AI could do a lot of small decisions with fairly obvious criteria and finally make criterias for optimization. However, what it definitely can be programmed to take into account is small details to annoying to human players to bother.
AFAIK, somewhen in 1.7-1.8 time Wiz once said that it is fairly easy to make AI ravage player's space-based resource production (which early-to-mid game at time could be about 2/3 of total production) by tens of small raider fleets. It would frustrate players to no end, so it wans't implemented. But the protencial to make AI extremely hard to deal with was there.