There is a lot of discussion on where Prophet Adam (a) was before his earthly trial. Shias generally believe that it was not Jannat al-Khuld (the heaven that people go to on the Day of Judgment). It was another garden. Some believe that garden was somewhere here on earth in an elevated place. Some believe it was on another planet.
Note that I didn’t say Allah created Adam (a) on earth. The Qur’an says Allah said to the wants that He will create a caliph on earth. This means that the plan of Allah was to have Adam on earth, and he created him from earthly clay. But when he gave him life, he was in a garden. Then Allah tested him with the fruit in the garden, and then he was sent down to earth.