Issue it the two different gids, as the gid is LINKED into Oracle, when Oracle is installed.
You can only resolve this by correcting the gid, and relinking Oracle.
Oracle is functioning as expected, and your hack doesn't work, sorry.
If you want to have it changed, submit a SR with My Oracle support.
As such this is not a topic for this community.
Senior Oracle DBA
Thank you for the update. I understand as the GIDs are not same, this issue is there. But if GID is the only issue, then how UTL_FILE is working correctly.