Player A fouls and player B is not paying attention
Player A tells player B you have ball in hand.
Player A fouls again and player B is not paying attention again.
Player A says its your shot and does not tell player B he has ball in hand.
Snooze you lose?
While it's bad form, it's not really illegal, although in leagues and other tournaments it's up to the players to call fouls, even if it's on them.
I think in some leagues the captain of the team is allowed to call a foul if the player does not, but they may be just bad memories and maybe not true.
This is why I tell people to pay attention to the table even when they are not playing. My son did this just days ago, he missed, hung up the cue ball in the jaws and walked away from the table to where I was. I look over and the guy has the cueball and is lining it up for a shot. Brains are a big part of this game, if someone wants to goof off, not do the right things mentally and have respect for the other player and the match, it's on them as to what happens.
Whoever was not watching should have been. While I don't think it's was proper for the other player not to say it was ball in hand, I am only 50% on either side, if it happened to me, I would not really be upset.