Not possible to replace authorization headers

It seems like the scripting methods for pm.request.auth do not do anything at all.
My API has a strange authorization flow and I need to authenticate through OAuth and do some processing on the token before I use it in the Authorization header, but no matter what I do it seems that it is not possible.

Here is what I tried:

  1. pm.request.authorizeUsing
    It simply doesn’t do anything. It is not even possible to switch to no authorization at all, this call is simply ignored
  2. pm.request.upsertHeader
    Doesn’t update Authorization header either
  3. pm.request.update({auth: { oauth2: [{type: 'any', key: 'accessToken', value: 'My updated header'}]} });
    Request is still sent with the original header
  4. Switched Add Authorization Data to Request URL and tried updating the both the headers and the URL. No authorization header is added, it is not possible to remove the extraneous authorization query parameter from the url via pm.request.url.removeQueryParams

I still have to use the OAuth2 authorization type on my request since I need to acquire a token through authorization_code grant and Postman doesn’t allow to show a sign-in popup through scripting.

Is there a way around this or is the scripting just extremely bugged?