How to calculate the oxidation state and the number of equivalents oxidized with YBa₂Cu₃O₇
Your fundamental assumption is that all of the oxygen is $\ce{O^2-}$. In oxide ceramics, however, it is possible for oxygen atoms to dissolve into the matrix. zirconia,  titania, and bismuth oxide can all easily accumulate non-stoichiometric oxygen. In fact this ability to "dissolve" oxygen into a solid matrix is how fuel cells are able to operate.

You are correct that the yttrium is $\ce{Y^{3+}}$, barium is $\ce{Ba^{2+}}$, and copper is $\ce{Cu^{2+}}$, but in YBCO the oxygen can form $\ce{O^{(2x-2)-}_x}$ sites as part of $\ce{Cu2O_x}$ ($1\leq x \leq 4$) clusters. Note: for $x = 2\ \ce{O^{2-}2}$ is not inherently a peroxide ion, you need cooper pairs of electrons to have superconductivity (see image below). Thus another way to present the structure of YBCO may be as $\ce{YBa2Cu3O5(O2)}$ or rather $\ce{YBa2Cu3O_{5+x}(O2)_{1-x}}$ or even $\ce{YBa2Cu3O_{3+3x}\nu^0_x(O4)_{1-x}}$ $(0 \leq x \leq 1)$ as the ceramic can be non-stoichiometric and produce oxygen vacancies which affect the superconductivity.