Providing a specific solution would require us to look at the actual code and debug the attribute type you’re working with, which falls outside our support scope. We can only provide general guidance on this.
If the double underscore method (__name) isn’t working, it’s possible the attribute isn’t a select-type field, since __name should return the display name for selectable attributes. Please note that this returns an array of names, so if you just use echo directly, it will appear empty, you’d need to handle it as an array.