In the Keep of Time, by Margaret J. Anderson (1977) seems like a standard time travel story--four siblings, unwillingly spending the summer with a great aunt in the Scottish boarderlands, explore the ruined castle nearby. Their aunt is its chatelaine, and has given them the key to the tower...and when they turn it (after it starts glowing, the way magic keys do), they travel back in time to the 15th century. But soon a twist appears--the youngest child, Olivia, has no memory of her contemporary self. Instead, she is Mae, grand-daughter of the castle's lord, with a family who loves her, and absolutely no inclination to trust her three siblings.
And to make things even more exciting, the castle is besieged by an English army, and its own fighting men are away on a cattle raid. Andrew, with Mae as his guide, is sent to warn them (exciting adventure in the past bit happens, including a battle between James II of Scotland and the English).
But for me, things really picked up when the three older kids drag Mae/Olivia back into the present with them. They had expected her to become Olivia once more, but to their consternation, she remains Mae. Child of the middle-ages that she now is, she is terrified and wonder struck in turn by the marvels of the present. And her siblings, seeing no other recourse, desperately work to make Mae into a child of the 20th century who their parents might not realize is someone who misses her "real" mother back in the past....In the process, the siblings come to appreciate each other more (which was something their parents were hoping to accomplish by sending them off together for the summer).
Then the key glows again...and the kids head back to the keep. Once more they travel through time, but now they find themselves several centuries in the future, and this might be the earliest example in a children's book of a future that imagines the consequences of sea-level rise from global warming caused by over-reliance on technology. The only inhabitant of the keep in this time period is an old, mysterious woman....who is able (off-stage) to return Olivia to herself (at least, enough so that she isn't Mae anymore....).
This book is the sort to knock the socks off the nine or ten year old who's never read a time travel book, the sort of book they might well remember for life. It's one that is best read as young as possible, though...I found it a pleasant read, but certainly it was not as emotionally powerful as it would have been to a younger me, whose relationships with siblings and parents were of primary importance.
I had read Margaret J. Anderson's Searching for Shona, but had not realized she'd written time travel books, two of which appear to be connected to this one. I'll be looking out for them!