Merge pull request #28779 from frappe/mergify/bp/develop/pr-28777

fix: Error on creating invoice (backport #28777)