Getting this error though the invoice number / naming series is less than 16 characters.
ERPNext v14
It’s not the series, but the ID itself that would be generated is exceeding 16 characters.
Refer the following:
https://docs.erpnext.com/docs/v14/user/manual/en/accounts/articles/naming-series-as-per-gst-rules