“magic hat theory” of the Catholic Church is essentially your way of describing the problem you see with claims of ecclesial authority and doctrinal infallibility.
As I understand your idea:
The Catholic Church can sometimes act as though it has a “magic hat” from which authoritative answers can be pulled whenever a theological question arises.
A teaching can be declared or treated as official, binding, or part of the Church's authoritative teaching, even when there is substantial uncertainty about whether it really represents the apostolic faith.
Later, the Church can clarify, modify, reinterpret, or even substantially reverse the practical theological implications of what had previously been taught.
The difficulty, in your view, is that the appeal to the Church's authority can become somewhat self-validating: “We know this is authoritative because the Church says so, and we know the Church has the authority to say so because Christ gave the Church that authority.”
That makes you skeptical of the idea that the ordinary magisterium is automatically protected from significant doctrinal error merely because something has been consistently presented as official teaching.
Your position isn't that nothing can be known through the Church. Rather, you seem to distinguish between the Church's genuine authority and the much stronger claim that every sufficiently authoritative-looking formulation necessarily possesses infallible divine protection.
You're wary of treating the institutional Church as though it possesses a literal theological “magic hat” that guarantees every sufficiently official doctrinal pronouncement.
The deeper philosophical point behind your theory is probably: authority doesn't eliminate epistemic uncertainty. Even if an institution really has divine authority, human beings still have to determine which statements actually carry that authority, what they mean, and whether later interpretations genuinely preserve or alter the earlier teaching