"Have you seen the books on these shelves? There are some serious books here. Banned books. Cursed books."
-- Scorpius Malfoy (CC1.19)
Scorpius Malfoy, Albus Potter and Delphi disguise themselves by taking Polyjuice Potion, enter the Ministry of Magic and sneak into Hermione's office, where the Experimental Time Turner they need has been hidden (CC1.19).
Scorpius is surprised at the number of dangerous and banned books contained in the Minister's bookcase - and particularly to find a book written by Sybill Trelawney, since he knows Hermione hated her Divination classes at Hogwarts. Opening this book, "My Eyes and How to See Past Them", triggers a series of riddle recitations and a powerful attack by the bookcase on the three of them - grabbing and pulling inside whomever it can reach (CC1.19).
Although Scorpius is in a panic at his friends being consumed by the bookcase ("The only thing I’m good at is thinking and when I need to think - I can’t"), he does solve the third riddle, saving Albus and Delphi. After extracting the Time Turner from "Shadows and Spirits" book, they leave the bookcase and Ministry behind (CC1.19).
They wonder why Hermione / the Minister for Magic needs to have these cursed books in her office, but it is never explained. We know Hermione loves books, so perhaps this was her opportunity to collect books together that she had always wanted to be able to access at Hogwarts.
From the Web
About the Cursed Child play: http://www.harrypottertheplay.com