Steps to recreate:
Be an admin user
Go to inventory, add custom medication.
Click the plus to add another ingredient to the medication
add a new custom medication with a new medication generic that is not in `concept_medication_generics` nor in `medication generics`. Then try to add a custom medication where there are two ingredients, and both of them are the new medication generic defined earlier. This medication with the two identical ingredients will not be added (no new medication ID is created.