Heat butter and olive oil in a pan over medium heat.
Once the butter is melted, add onions and garlic and cook for a minute, stirring continuously.
Add salt, black pepper powder, red pepper flakes, and brown sugar and mix well.
Reduce the heat to low. Cover the pan with a lid and cook for 30 minutes, stirring a few times while cooking.
Add apple juice and red wine vinegar and stir to combine.
Cover the pan again and cook for another 30 minutes on low heat, stirring a few times in between.
Remove the lid and cook on high heat for 3-4 minutes or until the liquid is reduced, stirring very frequently. Do not overcook otherwise the marmalade will become dry. Keep in mind that the marmalade with thicken some more as it cools down.
Remove the pan from heat and let the marmalade cool down to room temperature. Store in a clean jar in the refrigerator for up to 1 month.