Currently we can only retrive the enrollmentProfileName from the device resource type. The problem is that the same profile name can be used by multiple enrollmant profiles. Also all functions to retive aditional information on the enrollmant profile need the enrollment profile id to retrive them with the api.
You will faile to retrive the correct profile if you are comming from a device if we only have the name. I suggest adding the enrollment profile id instead of the name.