Functions id and elementId are currently defined as accepting either Node or Relationship. This can't be used by Cypher statements which have other types.
I suppose accepting Expression could be the best fit. There is a similar pattern with function keys, accepts Node, Relationship or Expression.