They were ordered there by the Emperor.
The adult novelization is slightly more helpful on why the Knights were there:
And suddenly all six were arrayed before him. His Knights.
For the briefest moment, Ben thought they'd come to help.
But hate rolled off them in waves like fetid air. The Knights of Ren had never been his. They had belonged to the Emperor all along.
A final betrayal.
Star Wars: The Rise of Skywalker: Expanded Edition pg. 218
From this, we can assume that if the Knights of Ren had always served the Emperor, they would have only been on Exegol to do the things they did because the Emperor commanded it.
There are also many reasons why the Emperor might order the Knights there, which the novel does not clarify. It is clear throughout the story that Kylo was not really planning on obeying the Emperor, so the Emperor may have used the Knights to deal with Ben whether or not he had turned. The Knights also may have known that Kylo was at risk of turning and could have communicated that with the Emperor. Finally, the Emperor could have just been using the Knights to guard the chamber from anyone, no matter who they were.