The problem I originally reported was not concerned with typing text, but text rendered in read-only buffers (ie. dired and minibuffer).
I have attached the report-emacs-bug too. Please note that I compiled emacs 27 myself on debian buster.
Also here's the bad news. Just now I realized that bug#41005 is not solved yet. At certain combinations of characters, the ligatures are still disjointed. Also I tried to change the font family, but that didn't help either. This doesn't happen when I compiled emacs using --without-harfbuzz option. I don't know if it helps but I can try to find if there's a pattern to the combinations of characters I mentioned.