The optimization condition checked if `recursively_defined` flags matched, which would apply when both are Yes. However, unions with recursively_defined=Yes may have been built during cycle_recovery where simplification is incomplete. Change the condition to require both builder and union have recursively_defined=No, ensuring the optimization only applies to unions that are definitely fully simplified.