In someways I also think it adds to Arya's whole arc and wanting to set a specific miraculous, but yet disparaging tone for the nature of the story viewers are left with.
There are very few scenes in the epsiode that were nuanced (Arya, Lyanna, Theon, Melisandre, Tyrion & Sansa, Dany & Jorah, Jon and Viserion, Knight King & Bran Godswood), as I think the point of the non-nuanced scenes were there to help the episode subvert the majority of fantasy elements that were initially set up in both the TV series and books by being more realistic.
But Melisandre's scenes were some of the more nuanced scenes too and her story really revolved around Arya's and making Arya "central" or "whole" as she full-circled the episode's story.
Even in the middle of the battle things become literally clearer when things begin to pertian to Arya such as Beric encouraging the Hound to help Arya, but then they pan (still clear) to Lyanna's Mormont's tragic scenes fighting the White Walker Wight Giant, as her story juxtaposes, but also foreshadow's Arya's episode arc, as Lyanna Mormont has always been a shade of Arya.
Samwell Tarly: That's what death is, isn't it? Forgetting, being
forgotten. If we forget where we've been and what we've done, we're
not men anymore, just animals...
The interior library scenes also call into the question the importance of the past, immediate (Jon Snow's secret heritage) and far-reaching (Westoros' secret history, the former identity of the Night King, and the true circumstances around his creation), as the over all result of the episode implies that the far-reaching past doesn't matter or spells out doom, as more of it is not revealed and/or nor did the Azor Ahai prophecy come true in terms of meeting certain aspects of it's criteria. So it's very curious that the library is the location of where Arya's fears become more apparent or her confidence is broken.
One also can argue the importance of the interior of Winterfell being a metaphorical "soul" of House Stark and Arya's fear represents the fear that they're all loosing, until she makes her way with Beric's and the Hound's help to a room that feels more 'center', a room with a large fireplace and a "hearth" where she given information to finish her journey seemingly from Melisandre and/or the beyond where her fear is mysteriously once again resolved (IMO there is an element of Gothic story telling with these particular sequences).