Cersei's POV revealing that she is highly delusional should cause us to reexamine AGOT entirely [SPOILERS Main]
Much of Ned's story in AGOT is surrounding his investigation into the death of Jon Arryn, where he learns he was investigating the parentage of Joffrey Baratheon, and had reason to believe that he might not be Robert's son at all, but Jaime's. His reading into the hair colors of all the different generations of Baratheons causes him to suspect that it could be true, so he confronts Cersei about it. The most definitive proof that it must be true is that Cersei not only doesn't deny it, she affirms that it is absolutely true. Closed case, done deal, off with their blonde heads.
But can we really believe her? It is an undeniable fact that Cersei believes wholeheartedly that Jaime is the true father of all her children. Thing is, she believes a lot of things wholeheartedly which simply aren't true. She believes Tyrion is living in the walls of the Red Keep, she thought the Faith Militant would be real chill with her, and she believes her servants are intentionally shrinking her gowns. Cersei is a narcissist whose grasp on reality is fundamentally broken.
So why, then, should we believe her when she says Robert isn't the father of her children?
She absolutely despises Robert for his years of abusing her. And rightfully so. It would make perfect sense for someone like her to convince herself it was completely impossible for someone she hated to be the father of her children. She also sees Jaime as being literally the same as her, and like most narcissistic parents she sees her children as an extension of her as well. She is the exact type of person who would deny any possibility that her children were their own people and not merely Of Her. Even if Joffrey is, in fact, purebred Lannister, Cersei believing that to be true is not a good reason to accept it. You would need external evidence.
So what about all that stuff with the hair color? Every Baratheon for generations had black hair, but Joffrey has gold hair. What's up with that? Aside from the fact that it is entirely possible for children to simply take after their mothers(Ned has 5 trueborn children, 4 of which have his wife's red hair), hair color isn't the only thing at play here.
Joffrey's hair is described as being quite thick. This is not the case for Cersei or Jaime. It's quite possible he got hair color from his mom, and hair texture from Robert. He is very tall for his age, just like Robert was. He has very broad shoulders, just like Robert did. He is prone to fits of rage, just like Robert was. His eyes are green, which might look real Lannisterish, until you remember Renly also has eyes which look green in some lights. Joffrey being blonde, in combination with all of these other traits, just doesn't seem conclusive enough on its own either.
Okay, well what about Jon Arryn's investigation? He found several bastard children of Robert's, all of whom had his dark hair and features. But how exactly would they identify a bastard of Robert's who took after their mother? If Robert got some red headed woman pregnant and she had a son with red hair, by what means would Jon Arryn even be able to identify them? He found bastards which looked like Robert, because looking like Robert was the only way to identify them as his children in the first place.
We also have to consider why Jon Arryn was conducting his investigation into the matter in the first place. In ACOK, we learn it is because Stannis suspects Joffrey might be a bastard, but he didn't want to tell Robert. This is a very odd claim from Stannis, considering Joffrey is like 11 when Stannis raises his suspicions. Joffrey has had blonde hair his entire life, and Stannis only begins to suspect he is illegitimate once the child is half grown? Seems to me like he would have started asking questions a lot earlier. The two historical cases we have to compare it to are Jacaerys Velaryon and Daeron the Good. Jace was called a bastard from the moment he was born, and he likely was. Daeron the Good was accused of being a bastard later in life by his father, and it was purely for political reasons because he wanted to disinherit him, and that claim is likely false. It makes sense to me that the claim most likely to be true is the one which began early, and the claim that was likely false happened much later and very clearly benefited the person making the claim. So now here Stannis is, calling a half grown child a bastard, and he has all 7 kingdoms to gain if this claim turns out to be true. He has good reasons to lie and bad reasons to suspect.
Plus, we have to consider Ned's biases. He hates Jaime and Cersei for their attempt on Bran's life, and rightfully so! He also has a bit of contempt for Robert for being the reason he had no choice but to lie to everyone about Jon's identity, and i could definitely see Ned feeling like exposing Robert's son as a bastard is some sort of cosmic justice.
And let's not forget the Red Witch looming large over all of this. Melisandre wants Stannis to be king by any means necessary. And even though we are told Stannis didn't start taking Melisandre seriously until after he fled to Dragonstone right before the events of AGOT, Lady Selyse was taking her seriously long before that. Melisandre who sees visions in her flames, who can use glamours to alter her appearance, who absolutely has the means to learn what Cersei believes about herself and her children, and concoct a scheme around it. Admittedly, this last bit about Mel is the single most speculative thing i am doing here. But even if Melisandre had nothing to do with it, everything else I've laid out here makes a solid case for why we should seriously question Ned's conclusions about the royal children.
Personally, I do not believe that Joffrey Baratheon is a bastard. I think he is Robert's trueborn son and legal heir. But even if he's 100% Lannister, the case built in AGOT just don't cut the mustard for me. Cause Cersei is whackadoo.