A ghost was first.
An 1838 Dublin University Magazine story, “An Anachronism; or, Missing One’s Coach,” has a man who misses his coach and ends up talking to the Venerable Bede. There’s no machine, just “a fault in the strata of time.”
Source: Dublin Univ. Mag. 11 (June 1838), 701–12; author unknown.
Factoids research notes