Android(Oreo) 8.1.0 Set DeviceOwer app causes "Workspace has been locked"
I found the problem:
Once you oem unlock(custom os) your device on a certain samsung knox level API, you can't be device owner anymore on this device.

This is from Samsung Knox page:


  "Cannot create work profile" "The security policy prevents the creation of a managed device because a custom OS is or has been installed on this device". 


The device could be vulnerable to potential attacks with custom os.