"Move along now," said a sharp voice. "The Sorting Ceremony's about to start."
. . . . . .Harry quickly looked down again as Professor McGonagall silently placed a four-legged stool in front of the first years. On top of the stool she put a pointed wizard's hat. This hat was patched and frayed and extremely dirty. Aunt Petunia wouldn't have let it in the house.
Maybe they had to try and get a rabbit out of it, Harry thought wildly, that seemed the sort of thing - noticing that everyone in the hall was now staring at the hat, he stared at it, too.
(Harry Potter and the Sorcerer's Stone)
I’m confused about whether ‘that’ is a relative pronoun or a demonstrative pronoun. The former doesn’t seem to make sense, so I think it’s the latter. If it’s a demonstrative pronoun, (1) is its referent the italicized sentence? And, (2) as a result, does ‘the sort of thing’ naturally refer to the ‘the Sorting Ceremony’?