This requires some lateral thinking as it is not something Word can usually do - but it can be relatively painless if you get creative.
Most languages like English start on the left and build words to the right (LTR) but other languages start on the right and work left (RTL). The languages going RTL actually put the page numbers before the text.
So your solution is to apply the RTL formatting to your TOC
after you refresh it. This is most easily done by adding a button on your Quick Access Toolbar. Refer to
How to write from right to left in Word 2016 / 365 / 2019? | EasyTweaks.com to see how to get both the RTL and LTR buttons on your Quick Access Toolbar. Put them both there in case of unintended use.
Once you have these buttons, refresh your TOC, select it and click the RTL button.