Hi Chitransh,
from our experience, currently it's not possible to use OAuth2 with the EXEC_REST_WS function from ASYRRESTCLI library. The header parameters used in this library are to short to hold a bearer token. You can't fix that without changing the standard library.
Another option (not so easy to implement) is to write a nodejs module that makes the external authentication and call. Then you execute the nodejs module from 4gl script with this library: https://online-help.sageerpx3.com/erp/12/staticpost/asyrwebser-api