I’ve deleted the entire build directory
rm -rf /Users/tomaszkowal/.asdf/plugins/erlang/kerl-home/builds/asdf_22.0-rc3/
and retried the build with
asdf install erlang 22.0-rc3
asdf list
Those two commands made it work again. I am not sure if it was an error pulling source code for the build but it never occurred again. I assume it was something on my machine.