I am trying to create a script that exports labels to annotation using the tool in ArcGIS Pro 2.4. I have created the contour layer, converted it to Layer and that works fine, but I am stuck on the creation of labels below is my script for the portion I am stuck on , this generates a label fine however the label is the ID column rather than the Contour column and I cannot work how to specify an expression. I have tried the help and suggested code (https://pro.arcgis.com/en/pro-app/arcpy/mapping/labelclass-class.htm) but this has not been any use it seems to suggest my layer does not support "SHOWLABEL" yet it generates fine using my code.
for lyr in aprxmap.listLayers():
if lyr.supports("SHOWLABELS"):
lyr.showLabels = True
lyr.expression = "[Contour]"
lyr.SQLQuery = "Type_ = 'Contour'"
print("Convert Labels \n")
arcpy.cartography.ConvertLabelsToAnnotation(aprxmap,
1000,
r"tester.gdb",
"try",
"DEFAULT",
"GENERATE_UNPLACED",
"NO_REQUIRE_ID",
"STANDARD",
"AUTO_CREATE",
"SHAPE_UPDATE",
"GroupAnno2",
"SINGLE_LAYER",
lyr,
"FEATURE_CLASS_PER_FEATURE_LAYER",
"NO_MERGE_LABEL_CLASS")`