Problem
We are trying to publish a workflow with some modifications in a productive environment (the server is divided in 2, one as App server and the other as Front End server).
The problem is that at some point if we add one more action we get the error shown in the image below.

We had the similar problem in the development environment (a single server instance) but we solved it following the resolution of the following case: Unable to publish or run workflows after installing SharePoint On Premises July 2021 CU | Community
It does not seem to be related to the size or limit of actions because, as we said, in the development environment it works normally.
In addition, in the past we also configured “EnablePreParseSecurityCheckForWorkflow = $false” according to: https://support.microsoft.com/en-us/topic/some-scenarios-of-sharepoint-2010-workflow-are-affected-after-applying-the-july-security-update-for-sharepoint-server-kb5004862-be361cd6-9f54-48c4-b890-2c4b7cf49d13
Otherwise workflows start to fail and do not launch.
Info
Windows server 2016 (1 App server and 1 Front End server)
Nintex WF version: 4.5.2.0