I have the exact same problem. Very disappointing for such a premium price. :(
Sometimes the keyboard stays backlit when putting the iPad to sleep, no matter if open or closed. However, not every time but I cannot find a pattern.
Quickly removing the iPad from the keyboard and reattaching fixes the issue and the keyboard then works as expected. This is a workaround but not a solution. I am not convinced that the backlight won't die at a certain point when it's lit all day while being charged on my desk. Battery drain is another thing to consider...
I want to avoid being without a keyboard. I will wait for the next SW update and see it this fixes anything. But then I consider seeing a genius or Apple support.
It's a 12,9 inch keyboard used with a 2018 iPad Pro, if that matters.