Not a bug; undoing reverts your champion state to what it was before you undid. So if you started with almost no health, you'll have almost no health again.
Otherwise, people could do cheesy things like:
Buy Avarice blade while healing for the extra gold per second, then undo just before you walk out of base.
Buy a Warmog's and undo, healing almost instantly(as opposed to having to regen slowly)
Buy a bazillion AP as GP, heal yourself instantly, undo it all and buy your AD items.
Healing instantly isn't that big a deal, but in a competitive game, when you're defending your base, it could make a pretty big difference. So you can't.
Homeguards specifically cannot be undone, since it has an immediate effect on the game(you get lots of ms and instantly heal) So it doesn't have the "bug".