Thanks Jose for your invaluable inputs. I will try that and provide a feedback shortly.
Regarding the occurrence it only happens on the live environment. On dev environment it is working perfectly.
No errors there. It is working perfectly there. So I guess it is because of write access that is denied to the folders in the live environment?
Can you explain this a bit more? Is it related to the link which I provided earlier?
Here is the console error https://prnt.sc/ue6x4c