There is no aspect of agile development that means that 'quality' (whatever that means!) cannot be delivered.
Forget all of the fancy words and meetings and tools and techniques. At the core, agile development is about breaking work down into manageable, deliverable, testable parts, and being able to flexibly respond to changes in requirements when they inevitably happen – the goal being to ensure you are always building the correct thing.
You're right that this might not be appropriate for some systems – particularly those where there are unavoidable complex, cross-system dependencies that define acceptance. That's fine – traditional engineering approaches are suitable for these cases.
But the idea that agile development is anything to do with "without oversight and every employee was working on whatever they wanted." is a complete nonsense.