Other ideas - if this is not the problem
See test_utils.py and write a test to replicate the problem
frappe@ubuntu:~/frappe-bench$ find . -name '*.py' | xargs grep money_in_words
./apps/erpnext/erpnext/controllers/buying_controller.py: from frappe.utils import money_in_words
./apps/erpnext/erpnext/controllers/buying_controller.py: self.base_in_words = money_in_words(amount, self.company_currency)
./apps/erpnext/erpnext/controllers/buying_controller.py: self.in_words = money_in_words(amount, self.currency)
./apps/erpnext/erpnext/controllers/selling_controller.py: from frappe.utils import money_in_words
./apps/erpnext/erpnext/controllers/selling_controller.py: self.base_in_words = money_in_words(base_amount, self.company_currency)
./apps/erpnext/erpnext/controllers/selling_controller.py: self.in_words = money_in_words(amount, self.currency)
./apps/erpnext/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py:from frappe.utils import money_in_words
./apps/erpnext/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py: total_amount_in_words = money_in_words(total_amount, company_currency.get(je_doc.company))
./apps/erpnext/erpnext/education/doctype/fees/fees.py:from frappe.utils import money_in_words
./apps/erpnext/erpnext/education/doctype/fees/fees.py: self.grand_total_in_words = money_in_words(self.grand_total)
./apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py:from frappe.utils import money_in_words
./apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py: self.grand_total_in_words = money_in_words(self.grand_total)
./apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py: from frappe.utils import money_in_words
./apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py: self.total_amount_in_words = money_in_words(amt, currency)
./apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py: {{frappe.utils.money_in_words(doc.base_paid_amount or doc.base_received_amount)}}
./apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py:from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words
./apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py: self.total_in_words = money_in_words(self.rounded_total, company_currency)
./apps/frappe/frappe/utils/data.py:def money_in_words(number, main_currency = None, fraction_currency=None):
./apps/frappe/frappe/tests/test_utils.py:from frappe.utils import evaluate_filters, money_in_words, scrub_urls, get_url
./apps/frappe/frappe/tests/test_utils.py: def test_money_in_words(self):
./apps/frappe/frappe/tests/test_utils.py: money_in_words(num[0], "BHD"), num[1], "{0} is not the same as {1}".
./apps/frappe/frappe/tests/test_utils.py: format(money_in_words(num[0], "BHD"), num[1])
./apps/frappe/frappe/tests/test_utils.py: money_in_words(num[0], "NGN"), num[1], "{0} is not the same as {1}".
./apps/frappe/frappe/tests/test_utils.py: format(money_in_words(num[0], "NGN"), num[1])