Hmmm, I’ll have to rebuttal here. If I implemented your change I would go from the original smiles that it produces.
NC([*:1])C(NC([*:2])C(NCC(O)=O)=O)=O
to
NC([*:1])C(NC([*:2])C(NCC(O)=O))=O)=
What did you get when you ran the code? Maybe perhaps I made a mistake in the example?