Manuel Harlan
This post contains spoilers for "Harry Potter and the Cursed Child."
At the end of "Harry Potter and the Deathly Hollows," we learn that Harry names his children James Sirius, Albus Severus, and Lily Luna Potter. With each name, Harry is trying to honor people close to him.
Albus Severus is the main character in "Harry Potter and the Cursed Child." He's the ugly duckling of the family, is sorted into Slytherin, befriends Scorpius Malfoy, and isn't good at magic. He's nicknamed "Albus Potter, the Slytherin Squib."
Albus and his father have a tense relationship. "There are times I wish you weren't my son," Harry tells him early in the play, setting in motion a rebellious streak in Albus.
Much of the play's plot deals with Harry trying to fix his relationship with his son, and Albus asserting himself as an individual hero, out of his father's shadow. But on a deeper level, Harry is dealing with the complicated legacies left by the two Hogwarts headmasters he named Albus Severus after: Dumbledore and Snape.
At the end of "Cursed Child," Harry and Albus fix their relationship. And Harry's only able to get there because of lesson he learned from Dumbledore and Snape - the two people Albus is named after.
Dumbledore first appears in the "Harry Potter" series as an all-powerful saintly wizard, but his legacy becomes more complicated. He withholds crucial information about Harry's past until the end of "Harry Potter and the Order of the Phoenix." Severus Snape was a cruel potions teacher and had little love for Harry, but we find out late in the story that he loved Harry's mother, and was willing to betray Voldemort for her memory.
Manuel Harlan
In "Cursed Child," Dumbledore is immortalized as a magical portrait, and can still talk to Harry. It's a way for Dumbledore and Harry to clear some of the baggage between them.
In one scene, Harry asks Dumbledore how to save Albus when he gets in trouble. "You ask me, of all people, how to protect a boy in terrible danger?" Dumbledore responds. He's still apologetic about how he acted two decades earlier.
Dumbledore also reminds Harry that he never had a son himself. It's a way for Dumbledore to echo the conversation he had with Harry at the end of "Order of the Phoenix," apologizing for how he raised Harry. He wants to make sure Harry doesn't make the same mistakes he did. Later in the play, during a second conversation with Harry, Dumbledore is still tortured by his actions and openly weeps in apology. Harry still has trouble accepting the apology - "You were absent every time it really counted," Harry reminds him.
Severus Snape, on the other hand, doesn't talk to Harry through his portrait. He shows up in the play in a segment of its complicated time-travel plot, where he helps save Scorpius Malfoy, and Albus. He becomes not only responsible for saving Harry in the first seven "Harry Potter" books, but Harry's son as well.
In the end, Harry follows Dumbledore's advice, trying to understand Albus for who he is. He also follows Snape's example: love is unconditional, even in the harshest of circumstances. By repairing his relationship with Albus Severus by the end of "Cursed Child," Harry also repairs his relationship with Albus Dumbledore and Severus Snape.
In a conversation at the end of the play, Harry brings up the legacy of the two headmasters:
HARRY
Those names you have - they shouldn't be a burden. Albus Dumbledore had his trials too you know - and Severus Snape, well, you know all about him-
ALBUS
They were good men.
HARRY
They were great men, with huge flaws, and you know what - those flaws almost made them greater.
It's the same with Albus. He has his flaws. But in the end, they make him greater.