I understand GRRM loves to write flawed characters. But generally a flawed character is one who is faced with tough decisions and may choose decisions that are often bad for them or others.
Moreso, a flawed character isn’t just someone who makes bad mistakes but they have underlying traits or beliefs that drives them to those bad decisions. For example: Ned Stark believes in honor and this causes him to not play dirty politics which leads to his death.
The problem with the writing of Viserys is that his actions are irrational to the point that the plot feels too overly constructed. To the point that GRRM is writing a flaw just to have flaw, and not give any reason.
Viserys went through a succession crisis himself when he was chosen as the heir over Rhaenys (spoiler: in the book it’s Laenor as Rhaenys was excluded from voting.) You would think that someone who saw first hand how the realm was torn into crisis mode and how the realm was very anti-woman-ruler, would want to avoid that same thing as King in the future.
Even in real history, kings have always thought highly of succession and gone through great lengths (marrying multiple wives, King Henry the VIII) to not only secure a male heir, but if needed ensure that their female heir is set up to succeed politically if needed. (King Henry I and his daughter).
Viserys on the other hand chooses to re-marry and produce a male heir but decides to keep a female as his designated heir.
Given what Viserys went through, this character shouldn’t have a belief that Rhaenyra should be his heir. Or be driven to produce competing male heirs.
For GRRM to write not 1 but 2 succession crisis so close together in Targaryen history seems too convoluted and a lack of thought for what characters would be motivated by from past experience.
I think the show tries to patch this up a bit (spoiler if you haven’t read the book) by making up the whole Song of Fire and Ice passed down orally from ruler to ruler, maybe viserys feels only someone with more targaryen blood purity can know the song and that’s why he doesn’t choose Aegon as a successor to hear the song. But this is never talked about in the show or the books
For someone who knows the issues of succession first hand Viserys does nothing to alleviate it and there is no underlying belief given to us by GRRM (aside from, “well Visery would just rather be reading history books than be king,”). I would have liked to see a more thoughtful worldview as to why Viserys would come to this decision.