The order of the data cause different fitting result

Here is the code, can you provide some help?