Can you share with me the error message you're getting when creating the 940 and 2021 W-2?
If you're unable to create the forms, I'd recommend running the Verify and Rebuild Data in QuickBooks Desktop. This will help us identify its cause and fix it. Here's how:
Choose Window then click Close All.
To Verify Data, choose File and select Utilities.
Click Verify Data.
If you see "Your data has lost integrity". This indicates that there is data damage in the file. Continue to the steps in this article to Rebuild Data and correct the problem.
If you see a specific error message, there may already be an article for it. Try searching for it in our QuickBooks Desktop support site for specific instructions.
If you're still getting a similar result, contact our Payroll Support Team. This way, they can check your account and verify the cause of the issue.