Idk what’s going on with my baby ftm

So he’s 4 weeks old and he’s normally really good about latching and eating. But occasionally he freaks out and won’t latch. I will literally have my boob in his mouth because he’s acting hungry and he will start screaming. But if I can get him to calm down he’ll latch on and eat a decent amount. Idk why he does it because it’s not like he’s starving. He eats well, is gaining weight and has regular bm and wet diapers.