Adding invoice document to order not working

Did you check the network tab of your browser for a matching error message? There is always a more explicit error message behind the 500.