Turns out you can totally write a book about a real-life person so long as
a) They're dead
b) You're incredibly popular
In some cases is the real person the protagonist. Sometimes the famous person just cameos to cement the historical setting. I'm not counting the cases where the author shows up, otherwise we'd be here forever.
And yes, I know Robin Hoid wasn't real, but King Richard and Prince John were.