A lookup field sometimes acts like a single text or numeric value, and sometimes acts like an array/list.
Although a lookup with multiple values appears with commas between values, when used in a formula, the commas between values disappear. This is because the commas were never really there in the first place. The commas in the lookup value were just used to display the array of values as a list.
In general, a rollup field is easier to use in a formula than a lookup field. Use an aggregator formula, such as ARRAYJOIN(), MAX(), or SUM() in your rollup to ensure that the result is a single text value, number, or date. If you do not include an aggregator, you may end up with an array that has unexpected results when used in other formulas.