Sorry,I can’t test this now,but it should work,i did not have any troubles.
Just thought,maybe you forgot to promote attribute to vertex,i think problem in this,it must always be done.
Cd for example is core attribute so it promotes automatically,but in case with custom attributes u must do it.