I mean yeah, dynamic libraries are great if used correctly (via something like Nix), but the unfortunate truth is, that they are not used correctly most of the time (the majority of the Unix and Windows landscape is just a mess with dynamic libraries).
With modern systems programming (Rust) the disadvantages of static compilation slowly fade away though via e.g. incremental compilation.
That said dynamic libraries are still a lot faster to link and can e.g. be hot-swapped.