The bitterness could be due to the quality of the raw garlic you used. It's best to use fresh, plump cloves without any signs of decay or green sprouts. If the garlic is cooked at too high a temperature or for too long, it can become bitter. The cloves should become tender and translucent without any brown or burnt spots. The bitterness could also come from the oil used for cooking the garlic. Some oils, especially if they are old or rancid, can impart a bitter taste. Ensure you are using fresh and high-quality oil for the best results.