The issue was solved by adding
export LD_LIBRARY_PATH="/usr/lib/wsl/lib/:$LD_LIBRARY_PATH"
to the .zshrc file.
.zshrc