wixLocation.to('/account/my-children/${wixUsers.currentUser.id}');

Remember that when you use a lightbox, that the ‘x’ button and the ‘close’ buttons are already setup for you, so you might have the ‘x’ button in the lightbox settings and the onClick event handler function in your code counteracting with each other.

If you want to use code instead, then you will need to delete them and make sure that they are not active in the lightbox settings.
https://support.wix.com/en/article/setting-how-your-lightbox-is-closed

If you do it through code then you might want to add the close lightbox line too so that the lightbox closes before moving the user onto the required page.
https://www.wix.com/corvid/reference/wix-window.lightbox.html#close

So, in your code example above which should be in your lightbox page code tab, you can simply replace the add your code here line with this instead - wixWindow.lightbox.close();