How to remove Socket in Group output node of a Material using python

I am trying to remove the unconnected sockets of Group Output node using python, I tried this

import bpy

obj = bpy.context.active_object
for mat in obj.data.materials:
    node_tree = mat.node_tree.nodes
    for node in node_tree:
        if node.name.startswith('Textures'):
            group_nodes = node.node_tree.nodes
            for node in group_nodes:
                if node.type == 'GROUP_OUTPUT':
                    output_node = node
                    sockets = output_node.inputs
                    for socket in sockets:
                        if socket.is_linked == False:
                            sockets.remove(socket)

But I am getting this error - RuntimeError: Error: Unable to remove socket from built-in node If anyone can help explain me why this method does not work, and how to remove it
Is this a bug or am I doing something wrong?