When call block on custom view:
$layer=$layout->createBlock('Magento\LayeredNavigation\Block\Navigation\Category');
Exception #0 (RuntimeException): Illegal state #0 /home/httpdocs/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(63): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->addFieldToFilter('category_ids', '169') #1 /home/httpdocs/vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext/Collection.php(479): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->addFieldToFilter('category_ids', '169') #2 /home/httpdocs/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(128): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->addCategoryFilter(Object(Magento\Catalog\Model\Category\Interceptor)) #3 /home/httpdocs/vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php(76): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->addCategoryFilter(Object(Magento\Catalog\Model\Category\Interceptor)) #4 /home/httpdocs/vendor/magento/module-layered-navigation/Block/Navigation.php(67): Magento\CatalogSearch\Model\Layer\Filter\Category->apply(Object(Magento\Framework\App\Request\Http)) #5 /home/httpdocs/vendor/magento/framework/View/Element/AbstractBlock.php(273): Magento\LayeredNavigation\Block\Navigation->_prepareLayout()