@ocdtrekkie
I had a good sense of where the film was going. Then "I'm My Own Granpaw" came on the jukebox, and I knew it was either directly from the Heinlein story or an Easter egg referring to it. This is an audacious and very successful attempt to film a story you'd think was unfilmable.
Another surprising film loosely based on Heinlein is the Japanese film "The Door Into Summer." Highly recommended.