And we can be pretty sure that Baby Yoda hug Cancer Awareness hope for a cure shirt in his younger days hundreds of years or more ago likely annoyed more than a couple of Siths in his time and built a name for himself as an extremely powerful force user long before becoming a member of any Jedi Council. So, it is definitely not beyond the realms of possibility that someone recognized the value of Yoda’s species, managed to get a DNA sample and commissioned the Kaminoans to create a clone of him as soon as they were able to develop their technology sufficiently to ensure that the force traits were also replicated. The latter potentially taking a lot of experimentation and time to perfect.
Plus, we know that Baby Yoda hug Cancer Awareness hope for a cure shirt can also utilize age acceleration tech within the cloning process. Which could mean that while physically the baby is 50 years old relative to its species, in reality, it could be far younger? This could also mean that within the Mandalorian series this baby could mature REALLY rapidly. This idea is strengthened by the fact that the man who wanted the baby alive.