When trying to access a secured layer backed by an app-schema data store, or, more generally, any secured layer backed by a data store serving non-simple features, the following exception may be thrown:
Simplest solution would be to make the getDataStore method in SecuredDataStoreInfo return a DataAccess<? extends FeatureType, ? extends Feature> instead of a simple DataStore. Note that this is already the case in DecoratingDataStoreInfo, which is SecuredDataStoreInfo's parent class.