No need for function nodes. It is just one variable to define in context (I used global context but the flow context is same as good) and you then need to change the value of that variable when needed. The event of that variable changing is also sent to the change node before button which then figures out the label for button. Button itself sends out the variable form context.
[{"id":"3a4c8a92.66dd36","type":"ui_button","z":"9f4fbba4.68ceb8","name":"","group":"152dfbc2.b2a224","order":1,"width":0,"height":0,"passthru":false,"label":"{{payload}}","tooltip":"","color":"","bgcolor":"","icon":"","payload":"tabToGo","payloadType":"global","topic":"topic","topicType":"msg","x":410,"y":700,"wires":[["e9aee8c5.98eec8"]]},{"id":"3cc0e2a9.fe0d9e","type":"change","z":"9f4fbba4.68ceb8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"'Go to tab '&$globalContext(\"tabToGo\")\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":700,"wires":[["3a4c8a92.66dd36","f67a7e56.3ba28"]]},{"id":"16f79dbf.361cf2","type":"inject","z":"9f4fbba4.68ceb8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":170,"y":800,"wires":[["e862682e.8e6318"]]},{"id":"e9aee8c5.98eec8","type":"debug","z":"9f4fbba4.68ceb8","name":"BTN OUTPUT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":700,"wires":[]},{"id":"e862682e.8e6318","type":"change","z":"9f4fbba4.68ceb8","name":"","rules":[{"t":"set","p":"tabToGo","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":820,"wires":[["3cc0e2a9.fe0d9e"]]},{"id":"e758fc6.8f758","type":"inject","z":"9f4fbba4.68ceb8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5","payloadType":"num","x":170,"y":840,"wires":[["e862682e.8e6318"]]},{"id":"f67a7e56.3ba28","type":"debug","z":"9f4fbba4.68ceb8","name":"BTN INPUT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":430,"y":640,"wires":[]},{"id":"b28a92f7.4ea9c","type":"comment","z":"9f4fbba4.68ceb8","name":"Change button label ","info":"","x":200,"y":660,"wires":[]},{"id":"3cae34d6.cca44c","type":"comment","z":"9f4fbba4.68ceb8","name":"Change button target","info":"","x":380,"y":860,"wires":[]},{"id":"152dfbc2.b2a224","type":"ui_group","name":"IO","tab":"a0c30cd6.33919","order":3,"disp":true,"width":"7","collapse":false},{"id":"a0c30cd6.33919","type":"ui_tab","name":"Movement","icon":"dashboard","order":5,"disabled":false,"hidden":false}]