Is a symbolic expression, which can be evaluated at any point in the cell. It is not in a function space. You could project it into a function space (for linear grids I would use DG-0).
Usually curvature is better to import from a mesh generator if you are using linear meshes.
You could have a look at How to compute curvature of a boundary - #2 by dokken