Get node ID or URL in Twig on field level
The node in a field template is the parent entity you find in element['#object'], which you can use to build the path:

{{ path('entity.node.canonical', {'node':  element['#object'].id}) }}