Create this "String Mix-Up" function in as few bytes as possible
Stax, 16 11 bytes

ÄE┘¢8·╦Ωb•∩


Run and debug it online

The corresponding ascii representation of the same program is this.

Y#xyz|eyr|Sx?


This fixes the bugs in original version.  It uses conditionals and stuff.

Y                   Save 2nd input in y.  Now the two inputs are x and y.
 #                  Occurrences of y in x. (a)
  xyz               x, y, ""
     |e             replace first occurrence
       yr|S         surround with y reversed. (b)
           x        first input. (c)
            ?       a ? b : c


The result is printed implicitly.