I've just finished reading the ten Catherine Le Vendeur novels by Sharan Newman, mysteries set in twelfth-century Europe (mostly in France). Catherine begins as a novice at the Abbey of the Paraclete and a student of Abbess Heloise. At the end of the first book, Catherine leaves the convent, rather than taking final vows, and gets married. Thus she's not only an intelligent young woman but highly educated for a lady of that era. Like any reluctant amateur detective, she frequently stumbles over corpses or gets entangled in events that endanger her family and friends. She applies the logic she learned from her teacher to probe these mysteries. Over the course of her adventures, she crosses paths with many distinguished historical figures in addition to Heloise, Peter Abelard, and their son, Astrolabe. (Yes, that was actually his name.) Significant historical events such as important church councils, with the associated political controversies, provide backdrops to the stories. Judging from Newman's afterwords to the books and her expertise in medieval studies, she clearly took care to place the real people in the series at locations where they're known to have been or could have been in the given year and not to show them doing anything that conflicts with their documented personalities and behavior.
I once read a post on Quora that vehemently objected to including people who actually existed, regardless of which century they lived in, as characters in fiction. That attitude baffled me. I can't think of a valid reason to consider such fiction disrespectful, and a lot of excellent works would never have been written if authors accepted that prohibition as a rule. Several of Sharyn McCrumb's Appalachian "Ballad Novels" tell stories based on real events—for instance, THE BALLAD OF TOM DOOLEY, whose afterword explains that the narrative sticks as close to reality as she could manage. Since it's a novel, though, McCrumb was free to speculate about motives and invent incidents and dialogue. Barbara Hambly does the same in THE EMANCIPATOR'S WIFE, about the later life of Lincoln's widow but with flashbacks to earlier periods. I see no problem with portraying historical persons in fiction if the author does conscientious research, sticks to the recorded facts except when filling in gaps where creative license is appropriate, and doesn't show the subjects behaving in ways incompatible with their known characters.
Writers of alternate history and secret history, of course, have much greater scope for invention. "Secret history" refers to fiction that doesn't change the facts of the past as generally known and accepted but inserts other events, often supernatural, occurring behind the scenes: Vlad the Implaler was a vampire. Lincoln was a vampire slayer. Elizabeth I was a demon hunter. Wizards on both sides shaped the course of World War II. I can enjoy these kinds of novels as long as the depictions of historical figures stick close to their true-life personalities. Otherwise, why bother writing about them at all instead of inventing your own characters?
The closer we get to the present, it seems to me, the more problematic it becomes to use actual people as protagonists. Successful books, however, have been published on plot premises such as H. P. Lovecraft and Robert Howard on a road trip to confront eldritch horrors or C. S. Lewis and J. R. R. Tolkien fighting the forces of evil. Personally, I might have qualms about making fictional protagonists of people with still-living relatives and friends who remember them.
I do draw the line at the use of live, present-day celebrities as fictional characters, except as walk-on "extras" or as part of the cultural background. (E.g., the protagonist attends a concert by a famous singer or watches a presidential debate.) There's a subgenre of fan fiction, "real people" fanfic, that consists of stories about celebrities such as singers and actors. It even includes, incredibly, slash scenarios between living individuals. While I'm adamantly opposed to censorship and therefore don't advocate making this sort of privacy invasion illegal, one would think it would be precluded by good taste and simple courtesy.
Margaret L. CarterCarter's Crypt