Flatter/unflatten has a byte order input. You can also swap bytes or swap words, depending on what yo want.
In your case, you are reversing the two elements of the U16 array, possibly meaning that the two bytes of each U16 are actually in big endian but in the wrong array order. We need to know more details before we can give advice. Are you absolutely sure your explicit code gives the correct result?
If reversing each two-elements U16 array gives the correct answer, this would be equivalent. No loop needed.
You are changing the word order, NOT the byte order!