What's the Name of That Book??? discussion

This topic is about
School Spirits
SOLVED: Children's/YA
>
SOLVED. Ghost of young boy haunts school until his body is found in a secret room. [s]
date
newest »

What I remember definitely has spoilers- just a warning.
My memory is the main character is at a school, possibly a boarding school. It could be a house or something though. There is a ghost of a little boy that is haunting it and he finally realizes it’s trying to communicate and show him something. I’m the end, the ghost somehow leads him to a secret room that has some trick way to open. When he goes inside he finds the skeleton of the boy, and gets trapped inside because he can’t find the trick opening to get out. He realizes the boy must have gotten trapped inside and never found his way out and died. He eventually figured out (or the ghost shows him) how to get out and he is able to provide closure for the boy’s family who all just believe he went missing.
That is all I remember and I have googled everything I can think of to find it! I’m starting to wonder if my overactive imagination as a kid just came up with this as a dream or something but I swear I remember finding it on the shelves of the school library and checking it out… any and all help is greatly appreciated! Thanks in advance!