Even if Red Flag laws stopped the killer from buying his guns in 2019, those prohibitions are tie limited. Eventually, if he behaved he would have been allowed to make a purchase.
Also, he bought the guns in 2020, more than 2 years ago. It's not like the Uvalde shooter who purchased the guns...