The essence of the trope goes like this: Somebody creates a new biosphere or civilisation by accident, such as leaving some sandwich lying around. Often, the product is microscopic with respect to the creator and they get to play god, but that’s not a must.
It is essential that the the creation is accidental and not intentional (or unknown).
Examples I found (potential spoilers)
In 1960, Thomas Gold hypothesised that life as we know it may have originated from an accidental panspermia, i.e., some garbage left on Earth by aliens.
In Douglas Adams’ Dirk Gently’s Holistic Detective Agency (1987), life as we know it is caused by a crashed spaceship.
FaustEric (1990) discusses the possibility that a sandwich left by Rincewind at the beginning of time may be the origin of life on Discworld.
In the segment The Genesis Tub from the Simpsons episode Treehouse of Horror VII (1996), Lisa creates a civilisation by exposing a tooth to cola and accidentally discharging a spark onto it.
In the short story Ice Age by Michael Swanwick (2000), a civilisation matures in an ancient fridge. This was adapted into an episode of Love, Death & Robots (2019).
In the South Park episode The Simpsons Already Did It (2002), the kids create a civilisation in a fish tank by adding semen to sea monkeys. The resemblance a Simpsons episode (see above) as well as a Twilight Zone one (see below) are mentioned in universe.
The following feature microscopic life, civilisations, etc. that are of unknown origin or created intentionally:
Microcosmic God by Theodore Sturgeon.
The episode The Little People from The Twilight Zone.
The episode Wolf 359 from The Outer Limits.
The Futurama episode Godfellas.
The Rick and Morty episode The Ricks Must Be Crazy.
I would be surprised if Dirk Gently is really the first to use this trope in fiction, in particular since serious examples as well as the idea of a microscopic civilisation have been around much longer.
So what is the first example of this trope in fiction?