It is very hard to take a compliment! Often there are things going on in the background from our experience and from society/cultural norms that influence this. I think socially it's become implicit that accepting a compliment might come off as bragging or cocky (not that it's necessarily the case! But there's a 'downside' socially to how I come across to others). And of course what you've already identified - that compliments sometimes bring out our insecurities where we don't believe the compliment. Either we don't believe the source (that person says that because they HAVE to or they're just being polite) or we don't believe the compliment in ourselves (or both).
It's interesting to notice all the ways your mind treats a compliment - often one sided toward the negative - how quickly it whips out the list of ways to discount it. And the emotions like embarassement or discomfort. I wonder what accepting the compliment would mean to you? What might you be afraid of happening once you accept a compliment? Sometimes I think - well, they don't know the real me (sort of like I feel like I'm an imposter or a fraud) - even though most likely someone has seen a quality in me that is genuinely there, but doesn't get reinforced much. Maybe what might help is to take the compliment (just say thanks) and then think about how that compliment might actually be true about you - attach it to something that you can identify, your own experience or reason to make it feel more believable.