Why does my solution not work

https://practice.geeksforgeeks.org/problems/inorder-traversal/1#