I gave a tip in this article
https://4js.com/ask-reuben/ig-44/ which would normally help here. (environment variable not set to what you think it is)
At beginning of your program shortly after MAIN add the following
IF some-condition THEN -- Typically test for existence of a command line argument
RUN "env | sort > /tmp/yourname.env" -- use appropriate command for O/S
END IF
Run program in config that works and one that doesn't, and compare value of CLASSPATH, LD_LIBRARY_PATH, JAVA*. etc Normally find in moving from GDC-Direction Connection to Web via Genero ApplicationServer that an environment variable has not been specified in .xcf either all or correctly.
One thing puzzles me about what you typed though. You said "running POI-5.0.0 on IIS-10" and the entry for poidir being "c:\" but you also said "BDL is on RHEL8". When you have IMPORT JAVA it is using the Java on the same server as the fglrun. So if BDL is on RHEL8, then your Java and Apache POI should also be on RHEL8.
Reuben