Workspace custom property doesn't work as driver's variable
Define the prop.

In as much as I agree with @DRF that using workspace properties as input into drivers is not a good idea...

Appears it is with custom properties, ie those defined via custom props panel or via script with

context.workspace["prop"] = 44.55


on the workspace that create the error.  Trying instead the  users property of the workspace it "works" (ie doesn't throw the error) as a driver variable.

If in script a property is defined via

bpy.types.WorkSpace.prop = bpy.props.FloatProperty()


in which case can address it via

context.workspace.prop




it will also work as a driver variable.

Since prop is stored as the custom property of same name will see the API defined message beside it.

Note: as mentioned this "works" as in it doesn't throw an error.  It does however print warnings to the system console, and updating by pressing "Update dependencies" button.

Unhandled ID WSGeneral
add_relation(RNA Target -&gt; Driver) - Could not find op_from (RnaPathKey(id: WSGeneral, prop: 'prop'))
add_relation(RNA Target -&gt; Driver) - Failed, but op_to (OperationKey(type: PARAMETERS, component name: '', operation code: DRIVER, 'location')) was ok