REPLACE Z VALUES
If a feature has an attribute called "Z Val", that is entirely independent of the feature's geometry. The geometry is not stored as a standard attribute. (A point geometry's coordinate can be copied to a standard attribute, but they remain as two independent values - updating one does not update the other).
If you want to update the geometry, you may want to use the SHAPE@Z token in the UpdateCursor instead of (or as well as) the Z Val field. See: https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/updatecursor-class.htm
with arcpy.da.UpdateCursor(geom, ["Z Val", "SHAPE@Z"]) as cursor: for row in cursor: row[0] = 0 row[1] = 0 cursor.updateRow(row)
NB: This version excludes your if condition. If you want to leave negative numbers as-is without changing them to zero, then you would need to re-add the if condition. If you do add the if condition back in, don't run the updateRow() outside of the if. No point updating the row if nothing has changed.
(In datasets that I manage, I never store coordinates as an attribute, such as Z Val, as there is no guarantee that this is the true coordinate of the feature (geometry is stored separately). If my users want to see coordinates in a table, I create a copy of the feature class, use the 'Calculate Geometry Attributes' tool to add and populate coordinate fields to the copy, export the copy to a spreadsheet and then delete the copy. If this is something my users may want frequently, then I'll create a simple tool that does all this with the click of a button.)
REMOVE Z VALUES
If removing z values altogether (rather than setting them all to zero) is what you're after, then refer to ESRI's instructions at: https://support.esri.com/en-us/knowledge-base/how-to-remove-z-values-or-m-values-from-a-feature-layer-000026846
(In this case, you may also want to delete the 'Z Val' field).
if row[0] == >0:should probably beif row[0] >0: