Note: I just realized that in Greek mythology, demigods probably find out later in life (sometimes) that their mother was impregnated by a god. Also, "changelings" might be brought up by their human parents who do not immediately tell the changeling his origin. So I would like to qualify this -- I am interested in science fiction, not folk tales or mythology.
There are many stories, certainly by the 1960s, in which a human discovers he is a robot. There are plenty of stories also where a creature resembles a human but is not. I am pretty sure Frankenstein's creature knew he was artificial as did the creatures in Island of Dr. Moreau.
But a story in which an apparently human character discovers he is artificial or an alien, etc. is inherently more complex. In the 20th century stories where someone is living as human, they have artificial memories (like in Blade Runner or other PKD stories -- I think Dick had multiple stories with the theme); fake memories are a requirement almost which is perhaps why 19th science fiction would not have the idea of an artificial human discovering his true nature.
I was thinking HP Lovecraft has other people thinking a monster is human but not sure any of his stories have the monster its being deluded although a movie made from one of his stories had someone discovering he is a sea creature of some sort -- the movie is Dagon but the movie does not follow the original story very closely.
Just to emphasize, I know that creatures pretending to be humans probably predate even Greek mythology but again, I am looking for the creature itself not realizing its true nature, even if other characters already know and in fact keep this fact from it.