Session was not created by this client (NodeJS)

Hello,

We have a cron job trigger that is writing using transaction that started to fail due to the error.

failed to insert document: session was not created by this client

We cannot pinpoint exactly when it started to fail (for unrelated logging reasons) however we noticed it recently.
The code looks something like this:

// this does not work
const serviceMain = context.services("main")
const serviceSystem = context.services("system")
const collectionA = serviceMain.db("main").collection("A")
const collectionB = serviceSystem.db("system").collection("B")
// transaction created from **service "main"** to insert in both
const session = serviceMain.startSession();

Both services are on the same running instance, so I assumed that before, under the hood, the same client was used (which I think was happening before).

However it looks like something has changed and a different client is created between difference services regardless that the DBs are on the same instance.

Any ideas why is this happening and if there is a way to solve it?
Thanks

UPDATE:

We since tried a different solution, which is to use the same service, however it should not work (at least to our understanding) as the service does not contain the databases being access “main.system”.
Is it safe to do so?

// this works
const serviceMain = context.services("main")
const collectionA = serviceMain.db("main").collection("A")
const collectionB = serviceSystem.db("system").collection("B")
// transaction created from **service "main"** to insert in both
const session = serviceMain.startSession();