Help identify an old children's book

I am looking for a book I had as a kid. I don’t remember the title, but it may have been part of a series. The binding was upside down. The frame was a magical genie/leprechaun/angel type whose job was to help kids in terrible situations, but who usually messed up.

In the book I had, the boy he was trying to help was in the hospital after being hit by a car. His dog died pushing him aside, saving the boys life. The boy was so sad and guilty about the dog, he wouldn’t eat and was dieing. The magical creature showed up and transported the boy to medieval England and Robin Hood type adventure with bowman and his dog.

Does this sound familiar to anyone? I have tried Google and come up empty.