If you only have two males or two females, you can usually simply fix the problem by removing the animals from the pen and back into your inventory, and then putting them back into the pen. To return an animal to your inventory, just click on this button in its ring menu: