As MS says in MSDN:
For improved performance, Microsoft Dynamics CRM caches plug-in
instances. The plug-in's Execute method should be written to be
stateless because the constructor is not called for every invocation
of the plug-in. Also, multiple system threads could execute the
plug-in at the same time. All per invocation state information is
stored in the context, so you should not use global variables or
attempt to store any data in member variables for use during the next
plug-in invocation...
https://msdn.microsoft.com/en-us/library/gg328263.aspx
Simply said do not use local variables in plugins.
If you're looking for autonumbering only than use an approach similar to this
https://www.linkedin.com/pulse/custom-auto-numbering-6-quick-steps-ms-dynamics-crm-eran-fuks