Yes, it does matter. There are 3 things that are required for the sacrament of the Eucharist to be valid:
proper matter and form
a validly ordained priest
the priest must have the proper intention
Many Protestant communities use grape juice instead of wine. That is invalid matter. They also don’t always use the anything similar to the institution narrative.
Very few non-Catholic faith communities have valid lines of Apostolic Succession.
However, presuming valid matter and form and a validly ordained priest, there still must be the intention to do what the Church intends. If there the community/church does not believe in the Real Presence there can be no proper intention.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.