Are you sure this is the correct visitor for Ambiguity?
In BasicTransformer I had more code. It would use a try-catch block each time it visited a child.
If it caught an exception from that branch, it would remove the child.
I use this extensively in the disambiguation filters.