NXP-13409 regression in duplicate name detection

This reverts commit 31be9fa1b90b3d5dbb4bed6597a4c7e6332e9402.