After my test, your problem lies in the treeView1_MouseSingleClick event handler. You used treeView1.SelectedNode.Text. In some cases, SelectedNode may lag behind in displaying the previous selected value. Therefore, when you click a new node, SelectedNode has not yet updated to the node you currently clicked.
You can try to change var menuItem = treeView1.SelectedNode.Text; to var menuItem = e.Node.Text;. e is an object of type TreeNodeMouseClickEventArgs, which directly points to the currently clicked node.
In this way, menuItem will directly obtain the text of the node you clicked, and will not be affected by the delay in updating SelectedNode.