How does Refining works?

So, with todays patch refining is a thing.
Its stated that 1 perk is removed and I choose, which is used insead.

But I cant choose a perk there. I just get a random one.
So, whats a deal about that?

You pick the perk that gets gambled on. It’s not a transfer of perks from other weapons to your chosen one.

You can re-roll one perk on a weapon. It locks out other ones from re-rolling.
Roll here, as in you get a random result, you cannot pick the one you want.

So, its another RNG mechanic.
It gets exhausting.