Argument 4 passed to Vendor\Module1\Controller\Result\Index::__construct() must be an instance of Magento\Framework\View\Result\PageFactory, instance of Magento\Search\Model\QueryFactory given, called in C:\xampp\htdocs\magento2x_5test\app\code\Vendor\Module2\Controller\Result\Index.php on line 36 and defined in C:\xampp\htdocs\magento2x_5test\app\code\Vendor\Module1\Controller\Result\Index.php on line 22
To removesolve this error, correct the sequence of the arguments in the parent::__construct(arg1, arg2, . . .) method. It must be same as it is in the parent's __construct().
so, to remove this error :
change
parent::__construct($context, $catalogSession, $storeManager, $queryFactory, $layerResolver); to
parent::__construct($context, $catalogSession, $storeManager, $resultPageFactory, $layerResolver, $queryFactory); this should solve the abovementioned error.