The strings are exactly the same. Why does Cypress think they are different?
const resultsMessage = `Search results for ${testQuery}`;
cy.get('[data-test=results-header]').then((el) => {
expect(el.text().trim()).to.contain(resultsMessage);
});
expected 'Search results for featured calc when logged out'
to include 'Search results for featured calc when logged out'
Maybe a bit of a late answer but I ran into the same problem today. I suspect that the html text you are comparing contains one or more  . Is this the case you can replace them as follows:
see: https://github.com/cypress-io/cypress/issues/9531