It is very simple. Either Company X or Y might have created UAN number for you and your Aadhaar and PAN might have been linked to UAN number. So obviously when Company Z tried to create new UAN number based on your words, they might have got failed due to existence of previous UAN number and the PF login will show the presence of previous UAN number with details.
So always share your UAN number wherever you join. UAN number is going to be one time allotment and the same will follow which ever number of company you are going to work for till your retirement.