this methode try to convert your content (the invoice) into json. part of this content is also the http-status-code. if the script to call this function doesnt send the code, you get the error
not possible for me, to say, where you have the problem. some changes on the server or server-settings? new php-version, new wb-version?