Perhaps there's a dark force at play. A dark wizard could have put a curse on him that immobilizes him on the bed. This could be part of a larger plot to either get information from him or stop him from interfering in their evil plans.
He could discover a hidden power within himself while lying there. Since he's always in the midst of action, this forced rest might give him time to tap into some latent magic ability he didn't know he had.
One possible reason could be some sort of dark magic or a spell that has been cast on Harry Potter. Maybe an enemy of Sirius wants to use Harry to get to Sirius through this strange compulsion.
It could be part of a new magical trend in the wizarding world. Just like in the Muggle world, wizards might start wearing masks for fashion or to show their allegiance to a certain group or ideology. Harry, being a trend - setter in many ways, decides to wear one. And perhaps it has some hidden magical properties, like protecting him from certain spells or jinxes.
Well, it could be a way to show Harry's rebellious side. He's always been a bit of a rule - breaker, and wearing heels could be seen as a new form of that. Maybe the author of the fanfiction wants to create a more unique and modern version of Harry. Also, it could be related to a plot where Harry has to disguise himself in some strange way and heels are part of that disguise. It gives a whole new dimension to his character and the story.
One reason could be a misinterpretation of the characters' struggles. In the original series, the characters face many difficulties, but they always find a way to persevere. However, some fanfiction writers may take those struggles too far and end up with the idea of suicide. Also, there might be a lack of understanding of the impact such content can have on the readers, especially the younger ones.
Perhaps there is a political reason. Some powerful pure - blood families might be trying to strengthen their influence by uniting the Potter and Malfoy families through this marriage, even if it's by force. Another possibility is that there is a prophecy that they misinterpreted which led them to force this marriage.
One reason could be a powerful dark magic spell cast upon him by a new villain in the fanfiction world. This spell might be designed to make him disappear from the wizarding world entirely.
One possible reason could be that a powerful dark magic spell has been cast on him. Maybe a new dark wizard or witch, created specifically for the fanfiction, has found a way to make him vanish to cause chaos in the wizarding world. Another reason might be that Harry has chosen to disappear himself. Tired of the constant attention and danger, he decides to go into hiding, perhaps using some long - forgotten magic or a powerful magical object to conceal his presence.
Maybe it's a part of a prank by some mischievous characters at Hogwarts. They might think it's funny to see Harry in a girl's outfit.
One reason could be a misfired spell by another character. For example, if a young wizard was experimenting with a transportation spell and it backfired, it could accidentally force Harry to be attached to Snape in this 'ride' situation. Another reason might be a plot by a dark wizard who wants to see chaos at Hogwarts. They figure that forcing Harry and Snape together in this strange way would disrupt the normal order of things.