The scaffold tree generator should create all possible parent scaffolds of a scaffold. In case of fused ring systems with neighboring aromatic and non-aromatic rings the procedure may be non-deterministic depending on the input data. The CDK data structure does not only store that a bond is aromatic, but also if it is a double or single bond. There are multiple ways how single and double bonds can be set in aromatic rings and this depends, e.g., on the SD file the molecule is read from. Therefore, molecules that should be considered equal (and in fact are considered equal by canonical SMILES the scaffold tree is based on) may still differ with respect to the bond order in aromatic rings. When an aromatic ring is removed the bond shared with a non-aromatic ring is turned into a double bond according to the scaffold tree algorithm. However, if this leads to an C atom with valence larger than 4 the obtained structure is not considered a valid parent. Valence is calculated according to single and double bonds. Therefore, this depends on the underlying representation of aromaticity by single and double bonds, which is not unique. The attached image shows a problematic structure.
As a consequence the structure of a scaffold tree may differ depending on the ordering of the imported molecules, since a scaffold is not simplified again when it is already contained in the tree.
It should be possible to reproduce this bug with the following two SMILES both corresponding to the above structure:
C=1C=C2NCCC=3C=CC=C(C=1)C2=3
C=1C=C2NCCC3=CC=CC(C=1)=C23