Yes, infinite spaces can prevent search engines from identifying important content. According to Google, if Googlebot reaches infinite space URLs, that
“could result in Googlebot failing to completely index the real content on your site.” source
Google also recommends:
“use the robots.txt file on your web server to manage your crawling budget by preventing crawling of infinite spaces such as search result pages” source