F. Scott Fitzgerald arrived in Hollywood in 1937 a broken man. His literary moment was a decade past, eroded by weak sales, alcoholism and, as Stewart O'Nan imagines in his novel "West of Sunset," titanic self-loathing. "I'm the king of things going wrong," Fitzgerald tells his institutionalized wife, Zelda, before he begins writing for the movies. At 40, he's weary and trapped by debt, and the MGM writers' building stokes the sickly mood: It's nicknamed the Iron Lung.

O'Nan's sweet spot is contemporary realism, but it's obvious why he finds Fitzgerald's final years so intriguing. O'Nan is shrewd on class, and his Fitzgerald remains the St. Paul boy desperate to rise above his station. Humphrey Bogart, a neighbor in the first building where he stayed, is more a hardscrabble confidante than a movie star. Though Fitzgerald quickly falls for a gossip writer, Sheilah Graham, a woman with her own déclassé past, he's just as quickly tormented by his betrayal of Zelda. "This sweet espionage was exhausting, and made him feel craven and old," O'Nan writes.

This hardworking, earnest man was financially but not emotionally rewarded in L.A. He worked on a variety of scripts, including a stint on "Gone With the Wind," but received credit for only one screenplay at MGM, the 1938 love-and-war tale "Three Comrades." Life was a two-steps-forward-two-steps-back business: He'd fall off the wagon and climb back on, grudgingly visit Zelda and cheerfully support his young daughter, lose Sheilah's affections and win them back. "He'd had a talent for happiness once, though he was young then, and lucky," he thinks. "But wasn't he lucky now, again?"

And so on, till death in 1940. Fitzgerald's manic cycle in "West of Sunset" is glum and routinized, at times wearying. That "West of Sunset" often plods isn't wholly O'Nan's fault — he's determined to convey Fitzgerald's life accurately and respectfully, contradictions and all. But fact can be hell on fiction, and the urge to correctly orient his subject seems to defy O'Nan's efforts to get inside his head. Emotional interiority is O'Nan's sweet spot, too — 2011's "Emily, Alone," to pick just one example, was a complex vision of an elderly woman's everyday life. His Fitzgerald, though, is more a mix of script assignments and the hollow sound of his pingponging emotions.

There are flickers of humor in "West of Sunset" that suggest the novel's tone might have been as surrealistic as it was existential: On the "Wizard of Oz" set he spots "munchkins and flying monkeys forking up chicken croquettes and spaghetti," and the run-ins with Bogie and Joan Crawford have an arch comedy. O'Nan's choice to put his earnest hero to work makes historical sense. But Fitzgerald's hard work often feels labored.

Mark Athitakis is a reviewer in Phoenix.