6 month old randomly gags or throws up

For the past maybe 2 weeks my 6 month old has started to randomly gag or throw up. I noticed it started the day after we introduced butternut squash and water. We could be laying in bed and I’m about to put my nipple in his mouth and as he’s opening his mouth to put my nipple in, he’s want to gag so he kinda avoids my nipple for a minute then feels better and starts nursing. Or he could be laying duren next to me being a happy baby then randomly he will forcibly vomit that it shoots out his nose and mouth. He seems other wise a happy baby and he was healthy at his 6M check up, is this something that happens? Im a FTM so idk if this is normal when they start having solids. He hasn’t had butternut squash in case it was an allergic reaction but he still gags or throws up. I even thought maybe my nipple was dirty but I usually clean it before I nurse.

He’s also teething, his first tooth has broke through but isn’t all the way out yet so could it be excessive drooling?