Looks like you have found a logical bug in the query process. But the “right” way of doing it is.
{
A as var(func: has(Worker.abilities))@cascade {
Worker.abilities @filter(uid_in(Ability.knowledge, 0x2e0))
}
results(func: uid(A)) {
uid
}
}