Oh, what was the second?
The Star Trek episode "Assignment: Earth" was the second try at the premise. The first was the original 1966 pilot script for a half-hour series of the same name that would've been unconnected to Star Trek -- although it could've potentially tied in, since it had Gary Seven sent back from 2319 to fight time-traveling, shapeshifting villains seeking to prevent humanity from achieving its future destiny as an interstellar power.
And it might have been a sitcom. I'm not sure. The parts of the pilot script that translated most intact to the Trek episode were the humorous scenes of Roberta encountering Seven and dealing with the high-tech gimmicks in his office, and the supporting characters included a building superintendent who was explicitly likened in the script to I Love Lucy's William Frawley and a suspicious police detective named Lt. Brunner who was set up as a long-suffering foil for Seven, very much like Detective Brennan in My Favorite Martian. But if it was a sitcom, it was a very unfunny one, hence my uncertainty.