There’s a clear answer on the food safety part:
Not safe.
All unintended fermentation is potentially bad - you don’t know what exactly started to grow in your jars, just that something did - so the food safety verdict must be “not safe”.
If you want to prevent such an event in the future, stick to approved recipes and follow proper cleaning and preparation procedures. It’s hard to say what exactly went wrong, just that the problem was caused either by the parameters of the canning step (failing to reduce the existing pathogens) or by an improper seal (meaning bacteria reentering into the jars).
Home canning per the guidelines published by government agencies or other authoritative sources should give you a safe product, but the jar design will serve as a security mechanism: if the seal doesn’t work, the product is not safe. Failure of the seal right after cooling indicates a more mechanical problem (damaged jars, lids, or rubber bands, or a dirty rim), during storage is likely an indication of unwanted growths. Industrial canning also relies on such indicators, e.g. the “plopping” screw tops.
Further details as requested:
While oven-canning has been often declared unsafe by government agencies1 (although it was often enough done nevertheless), the German government has published instructions including a method for oven canning.
I am paraphrasing and translating the key parameters of the instructions into English below, please consider it as supplemental information only, not a full set of instructions. If you or future readers are inexperienced in canning, please do some further reading to learn about the basic principles before starting to preserve food.
For fruit:
Use a canning liquid of either
- 1/2 liter of water and vinegar plus 600g sugar or
- 250-500g sugar per liter water.
(I would personally choose the latter.)
Fill the clean jars with clean and prepared fruit or fruit pieces, do not use overripe, mushy or moldy fruit. Top with liquid, covering the fruit. Close jars, depending on chosen canning system.
Place the jars in a deep pan filled with water, the jars should not touch.
Heat the jars at 150-160°C fan-assisted or 150-180°C top/bottom heat until you see bubbles rising in the jars. (Personal remark: Make sure that what you see is truly steam, not just dislocated trapped air. If you see steady bubbling you should be fine.) Turn off your oven and leave jars in the closed oven for 25-30 minutes.
Note that the instructions above are for fruit, not for vegetables and not for meat.
Properly canned fruit should be good at room temperature for at least a year.
1 An - admittedly somewhat cursory - search on the website of the National Center for Home Food Preservation, set up by the USDA and others, yielded no definitive stance on the oven canning method listed above (with liquid covering the food in the jars and the jars standing in a deep pan or dish with water). There are warnings against “dry canning”, i.e. without liquid in the jars, because of improper heat transfer to the inside, and against heating the jars in a dry oven as not all types of jars can handle the temperature fluctuations and may break.