By design, Cite does not allow a <ref> to appear within another <ref>. (This is probably a result of parser design and concerns over maintaining the integrity of Cite's internal data stack.)
However, clever Wikipedians realized that one can use #tag to avoid Cite's design limitations and create functional nested references such as:
AAA {{#tag:ref| BBB <ref> CCC </ref> }}
(See also: T18330)
Recently, Cite was expanded to allow reference content to be defined within a references block, i.e.
Foo <ref name="bar"/>
<references>
<ref name="bar">blah blah</ref>
</references>
While most references work fine in this context, the #tag based nested ref constructions universally fail when moved inside <references>. Depending on the number and order of #tag calls used and the depth of the stack the result will either be an uninformative error message or a misnumbered reference list.
The solution to this is probably to create an implementation that generically supports nested refs. (Part of the problem is that Cite was not intended to allow for nested refs at all and though the #tag based hack worked previously because of quirks in parser behavior, the same call structure doesn't work when moved inside the references block.)
The "right" way to do this is probably to restructure Cite's internal data stack and change the way the evaluation of references are hooked into the parser. I will probably implement this myself eventually, though probably not for some months.
Version: unspecified
Severity: major
See Also: T24635: Multiple problems with refs inside <references>...</references> blocks