This could be because it was cooked too long. Overcooked garlic takes on a bitter flavor. Its important to cook the garlic until browned and softened.