The second last message has nothing to do with your query. You likely opened the invoices table in Workbench at 21:14:16 and have automatic row limiting active. Theres a green hook next to the message so everything was fine.
The last message is an error message related to your query. You have a space between MAX and the opening parenthesis. Delete that and you’ll be fine.