Aspose Words set license error when using it as part of plugin throws an error

We upgraded from 14.3 Tridion Docs to 15.1 and are running into an issue with setting Aspose license, as we updated our codebase to .Net 4.8 from .Net4.7.2 and updated Aspose to 24.0.1 we are getting the following when using Aspose in a publish plugin. We are unable to replicate this issue when using Aspose in command line script on the batch server, which ruled out it being an Aspose issue.

Fullscreen
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The plug-in looks like this

Fullscreen
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

emoji