To resolve this error, you can either change or remove the period lock date for the organization by going to Accounting --> Advanced --> Financial Settings in Xero. You can also use an invoice date after the period lock date.
See the following Xero knowledge base article: https://central.xero.com/s/#Settings_LockDate