According to the documentation for .flatten(), the function should operate recursively on the collection. We notice, however, that working with a MapImageLayer, that flatten() does not appear to check for sublayers within sublayers.
It should be easy enough to write our own recursive check for 'sublayers of sublayers' but wanted to ask the Community if there was anything we were missing here that might streamline the coding!?