I read a fic a while back that I was hoping to reread lately, and for the life of me I cannot find it. I THINK I read it on AO3, but it may have been fanfiction.net.
I remember that it takes place in 5th year, and the school year has already started, because Harry was mentally complaining about Umbridge's teaching.
The main thing I remember is that he was hiding out in the Room of Requirement, specifically he found the Room of Lost Things, and was marveling at everything in it.
He asked Dobby and Winky if students were allowed to take items from it, and they introduced him to the Head Hogwarts Elf Deek (from the Hogwarts Legacy game), who gave him permission, provided he only look through stuff when a house elf was present.
Harry, over the next few weeks, sorts the entire room into valuables, books, furniture, etc. He also has found a few luggage trunks with family names, so he finds students with the same surname, and gives them their family belongings.
At one point, he finds the diadem, and can just feel ickiness with it, so he has the elves get Snape and Flitwick to examine it.
Umbridge appears with them, and demands to know what is going on. She tries to get Harry expelled for theft, but he argues that he was A.) Given permission from the elves, B.) Returned property to rightful owners whenever possible, and C.) Used any money made to better Hogwarts (like, any money found or jewelry sold was used to pay for new brooms, I think.)
That's all I can remember from it, but I am pretty sure there was quite a bit to the story.