Just an update to this topic while I am diagnosing it.
location.reload(true) which in some cases loads a cached version of the document, which explains why you would see wrong version number in the response. I'm not quite sure what circumstances causes this, but it's actually quite difficult to bypass. See this post:
I have now added the following, hoping it will force browser to reload non-cached version of the document:
location.href = location.href.split('#') + (location.href.indexOf('?') > 0 ? '&' : '?') + 'version=' + new_version;
@Dans34 If you read this, please let me know next time you update if it works! 🙏