I was trying to exploit a client-side prototype pollution and nothing was working.
I figured out that if you try to use a script gadget by visiting a URL like this dirrectly:
https://example.com/#&__proto__[context]=<img/src/onerror%3dalert(1)>&__proto__[jquery]=x
will not work because the page will not load properly as the prototype pollution will break the page.