There is a bit of disconnect between the Help Center information on Lightboxes and the API documentation.
In the Help Center, the documentation shows how to close a Lightbox with an “X” graphic or a button. What is does not say is that if you select the button option, that button cannot be used to execute any code (like passing back data) when clicked in the Lightbox – it closes the Lightbox immediately.
The API documentation makes an obscure reference to closing the Lightbox “programmatically,” but that info is under wixWindow.openLightbox(), not under wixWindow.lightbox.close(). Regardless, the documentation between the Help Center and the API Reference should be consistent with one another.