New answer based on your update.
The problem is that your original time series is in two different formats -- not including the milliseconds when the time is exact to the second.
I'm frankly not certain how datetime() handled the conversion in this case, but if you compare your version of timex and mine, you'll see the difference.
There may be a more elegant way to handle that, but this works in a kludgy way:
timex = datetime(time_orginal, 'InputFormat',"dd/MM/yy HH:mm:ss:SSS");
timex(1:5:end) = datetime(time_orginal(1:5:end),'InputFormat',"dd/MM/yy HH:mm:ss");
Ideally, the solution to this would resolve the data format issue upstream, in time_orginal.