A similar error occurred now on Debian 11 under WSL2. The fix was to create the directory in /usr/local/lib, as mentioned by Miguel Gualdron (sorry, can't comment, and maybe it's better to have this as info for Debian too). The full error message is below.
Setting up libc-bin (2.31-13+deb11u2) ...
Aborted (core dumped)
ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
/usr/lib/wsl/lib:
/usr/local/lib:
/lib/x86_64-linux-gnu:
Aborted (core dumped)
dpkg: error processing package libc-bin (--configure):
installed libc-bin package post-installation script subprocess returned error exit status 134
Errors were encountered while processing:
libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)