No it is not correct that the display name and user name are related in any way. A username is created when the account is created. The display name can be changed at any time and reflects what the person wants to be called.
Providing us a sample of what you have coded would greatly increase the odds of us finding an issue in your code. In general the user's account information is stored in the identities
collection, of which there can be several. By default this collection isn't returned so you need to ask for it in your $select
query. See here.
Within the identity object itself you'll find the user's name, if they have one. This is ultimately what the Name
property on an identity returns back. It bubbles it up so you don't have to go through the process of navigating the identities.