How to avoid error "License check failed" + "System.NullReferenceException: Object reference..." when creating Studio project using API?

Hi SDL developers,

we are experiencing the issue that Studio project creation fails with the following error when using the SDL Project Automation API in our Studio batch project creation automation for Studio 2019 SR2 CU7:

License check failed, with exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Sdl.ProjectApi.Licensing.StudioApplicationLicenseManager.get_ApplicationLicenseManager()
at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense()

The error does not occur for every project, but the number of occurrences of this error seems to increase the more Studio 2019 project creation processes are run in parallel by the automation. When our developer lowers the number to just one project being created at a time, the error does not occur at all. When he sets it to e.g. 8 parallel instances, the error does occur (several times). In our previous version Studio 2017 SR1 CU11 where we used the same automation, we do get this "License check failed" error, but only with a different exception: "Failed to create plugin registry". We are familiar with that one and can't but disregard it, because it occurs when multiple Studio processes try to access our custom plug-ins at the exact same time.

We first thought that the new Studio 2019 "Object reference" exception might be a connection issue with the license server, which we use to activate the Studio 2019 installation on our automation server. But even after activating Studio with a single-user license instead (offline, because the server is not connected to the Internet), the error still occurred.

Additional info: Our projects are linking to GroupShare 2015 TMs (4.0.4318.4), which means, Studio 2019 is even "further away" from that old GroupShare version than Studio 2017 - could that be related? Or is this also somehow related to further limitations having been introduced with the 2019 API regarding the number of parallel project creation processes that can be run? Are there any workarounds we could use until we upgrade to GroupShare 2020, in case this issue is solved there? Unfortunately, the "Object reference" exception is a pretty generic one, and there doesn't seem to be any more info in the error message, so we don't know where this comes from.

We would appreciate help/guidance here.

Thanks!

Sophia