That sounds like an issue with your upgrade script/process as I do not believe ES 8.15.2 would run without that directory. It should therefore not be missing.
ES8.15.2 has all dirs , when upgraded to ES8.19.3 then indices dir was missing.
Have never seen that so it sounds to me like you have done something wrong somewhere.
Script work fine in all OS, issue is only in rhel8.9.
That does not mean there is any issue with rhel8.9. There’s nothing in this thread to indicate there is any issue with rhel8.9.
On the other hand, there is evidence you are not working/following correct, documented procedures. That will likely lead to more problems. First stage of solving a problem is to correctly recognize the real problem. As I've tried to suggest, stop looking at your scripts and think more if you have a deep enough understanding.
I’ve worked with elasticsearch for almost a decade, and with scripts and shells and applications and Unix/Linux for almost 40 years. From the world\’s biggest supercomputers to asset management tools for the world biggest banks to my raspberry Pi sitting next to me now. I dont think I could write a general purpose script to safely upgrade elasticsearch across all cluster types/scenarios, across even a limited range of Linux distributions.