Xorg segmentation fault after setting the mode of a reverse prime output twice, NixOS

Distro: NixOS
Xorg version: 1.21.1.8
Nvidia version: 530.41.03

After enabling reverse prime, using xrandr --setprovideroutputsource and then doing xrandr --output HDMI-1-0 --mode some-mode and then xrandr --output HDMI-1-0 --off or xrandr --output HDMI-1-0 --mode some-other-mode, X11 will crash with the following backtrace:

(gdb) bt
#0  do_lookup_x (undef_name=undef_name@entry=0x7f43d947502f "FreePixmap", new_hash=new_hash@entry=2264612598,
    old_hash=old_hash@entry=0x7ffd9f8573f8, ref=0x7f43d9472f30, result=result@entry=0x7ffd9f857400, scope=<optimized out>, i=0, version=0x0,
    flags=5, skip=<optimized out>, type_class=1, undef_map=0x105e7f0) at dl-lookup.c:388
#1  0x00007f43da704fc8 in _dl_lookup_symbol_x (undef_name=0x7f43d947502f "FreePixmap", undef_map=undef_map@entry=0x105e7f0,
    ref=ref@entry=0x7ffd9f857480, symbol_scope=<optimized out>, version=0x0, type_class=type_class@entry=1, flags=5, skip_map=0x0)
    at dl-lookup.c:776
#2  0x00007f43da70b432 in _dl_fixup (l=0x105e7f0, reloc_arg=24) at dl-runtime.c:95
#3  0x00007f43da70d78e in _dl_runtime_resolve_xsavec () at ../sysdeps/x86_64/dl-trampoline.h:130
#4  0x00007f43d948a3e9 in wfbDestroyPixmap () from /nix/store/3rzm84zv58dns6iards18v8yv3h9r9qw-xorg-server-21.1.8/lib/xorg/modules/libwfb.so
#5  0x00007f43d8ecab24 in ?? ()
   from /nix/store/4qb4ff10r8y93qjz5m941wzv14k9di98-nvidia-x11-530.41.03-6.1.30-bin/lib/xorg/modules/drivers/nvidia_drv.so
#6  0x0000000000000000 in ?? ()

I have traced the location of the FreePixmap symbol into Xorg itself, I’ve also verified that this isn’t a configuration file issue.

I’ve traced the segfault to this specific version of glibc glibc/dl-lookup.c at glibc-2.37 · bminor/glibc · GitHub . but from here I’m unsure how to proceed.

Lastly the nvidia-bug-report script seems to be unavailable on NixOS unfortunately. I’d understand if this seems like too much of NixOS specific issue, but in the backtrace it does pass through the driver, so I’m hoping someone here will be able to help.