That does not work delivering the expected results (coincidentally) only for the first cell. Thereafter they are not sorted.
Delete ALL expected results, wrap cells, align top and try:
=BYCOL(A1:S1,LAMBDA(x,TEXTJOIN(CHAR(10),,SORT(TEXTSPLIT(TRIM(x),," ")))))
Bookmarks