There's nothing complicated about it. It's a trope to pad out the story. In a story like Nisekoi, for instance, the author needs to draw out the romantic tension as long as possible to keep the story going. That's because once those tensions are resolved and the protagonist chooses a partner, the story's probably just going to end. Or at the very least, it won't be too interesting.
So, there are a variety of techniques employed. The protagonist can be clueless or oblivious to love, there can be misunderstandings and miscommunications (see Kimi Ni Todoke for a lot of that), they can just throw in new romantic interests even if they've got no hope of competing (like in Nisekoi), or the characters can be hopelessly shy.
I think the particular trope you're trying to look into might be close to one of these: The will they or won't they trope, the false start or the almost kiss. The false start trope, for instance is characterized by a character being ready to make a love confession, but getting derailed by something.
These can be stalling tactics, as I stated previously.
The will they or won't they page notes:
Actually [setting up the relationship is tricky and risky]. [Writers] are very reluctant to risk losing the valuable source of dramatic tension that is the (seemingly) unrequited relationship. After all, without that lovely source of drama, your audience could [complain]. As such, [many] writers [keep] the romantic tension building throughout the series, only [resolving the romance threads at the end].
Of course, keep this plotline going for too long, and you may encounter complaints [...] In addition, shows can go out of their way to avoid resolving the relationship, making ever-more-desperate narrative leaps.
The false start says:
This can be a highly effective writing technique for a couple of episodes, but the writers typically find that it's impossible to maintain forever. Eventually, the character will tell the object of his affections, and the plot will move on...or the viewers will.
The almost kiss page notes:
But this way, the tension and dreams of shippers remain for the writers to continue to take advantage of.
I tried really hard to find the exact trope on tvtropes.org for you, but I'm not sure if any of those were actually it. You're right though, that these tropes often makes the story really annoying; especially when you've seen them over and over. But as others have said, this is not a problem with anime, but rather a problem with the anime genres you in particular tend to watch. Some anime handle romance tropes very well.