My kids ask questions like this all the time.
Them: What if a shark jumped into a volcano?
Me: That wouldn't happen because sharks live in the ocean and can't jump high enough or far enough to reach land.
Them: OK, but what if?
Me: ... It would get burned and die...
So yes, if a pilot ejects and the plane had auto-pilot on and the auto-pilot was programmed to try to land after a pilot ejection and the plane was still safe to fly, the plane would in fact attempt to land.