Where is the definition of this function "layout.template_node_view"
It's defined in C code here: rna_ui_api.c#871

And this is called: node_templates.c#721

I don't know how to use it properly, but I guess you need to roll your own panel for your custom nodes in a custom node tree. This seems to work as panel draw code:

    def draw(self, context):
        layout = self.layout

        ntree = bpy.data.node_groups["NodeTree"] # our custom node tree
        node = ntree.nodes.active # selected node
        for socket in node.outputs:
            layout.template_node_view(ntree, node, socket)