The title of this question is somewhat convoluted. Essentially, a problem is in BQP if there is a Turing machine that runs in polynomial time that computes a polynomial depth quantum circuit that solves the problem.
What about something like this:
Suppose we have a polynomial time Turing machine that computes a quantum circuit that computes another quantum circuit. The final circuit solves a problem X. Is X necessarily in BQP?