After Effects Expression, layer not found or missing
I don't know if this counts as an answer so much as a workaround but I was getting the same error message when I was manually typing in the layer name. There was no typo; the layer definitely existed. It was maddening. 

But when I used the pickwhip to link it to the layer, After Effects would automatically generate the 'thisComp.layer("Layer Name Here")' code. Then I just built the rest of my expression around that line. That seemed to work fine.