Is there a way to successfully change the order of the segments after their creation and the MPD? Simply changing the order in the MPD doesn't work as the video player gets a strange behavior. I'm guessing it's something related to the segment's file internals such as the sequence number, presentation time or the initialization segment but I can't seem to figure it out. How do you implement the order in the player?
Presumably you are using a Media Source Extensions (MSE)-based client since you also asked this on the dash.js mailing list.
For mp4, MSE defaults to 'segments' mode which means that the timestamps in the media segments are used to determine playback order, not the order in which they are appended - this is why simply reordering them in the manifest does not work, and would probably lead to buffering issues when media with the expected playback time is not available.
It's unlikely any player does or will implement the behaviour you are looking for - the simplest way to get this working will be to repackage each media segment, essentially just adjusting the baseMediaDecodeTime to be correct for the order you are trying to achieve.