This is likely this bug ([import module /sql] import additional directory causes dt to stall · Issue #15861 · darktable-org/darktable · GitHub). It is fixed in master in PR that found other issues (po/import job asynchronous by TurboGit · Pull Request #15894 · darktable-org/darktable · GitHub).