This happened to me yesterday and I was confused for a minute since it has never happened to me before either. I tried numerous methods and tricks to get it fixed and finally I did manage to fix it. I've also written a quick step-by-step guide on how to fix when iMessage/Text Messages out of order on iPhone to help others who face such similar situation.
Here's an excerpt from the guide:
6 Simple Ways to Fix iPhone Stuck in Headphones Mode
1. Force Close Your Messages App.
The first thing that you should do is simply to force-quit your Messages app. (If ever an app is not working or seems not alright, try force-closing it and it should would work)
If you're on an iPhone X:
Step 1: Just swipe up from the bottom of your screen, and then hold for a second, then release to open your app switcher (your background-running apps/app history).
Step 2: Done? Great! Once you’ve done that all you have to do is just long press on your Messages app and then hit that red X button or swipe up on it to Force Close it.
If you're on an iPhone 8, 7, 6 or older:
Step 1: Just simply double tap on your Home button and then swipe up on your Messages card to remove it.
You can now try using your Messages app again and your messages now should be arranged in the correct order.
If that has not worked, then try to ...
2. Restart Your iPhone.
We rarely ever completely shut down our iPhones because we need it almost every time.
So when if something seems off or is not working on your iPhone you should give it a quick restart which gets it back on track.
Here’s how you can restart your iPhone.
If you're on an iPhone X:
Step 1: To shut down, hold your Side button whilst you hold on to one of your Volume keys.
Step 2: You will see Slide to power off. Turn it off and back on again. Done.
Note
You can also jump into your Settings app and then General and tap on Shut Down.
If you're on an iPhone 8, 7, 6 or older:
Step 1: To shut down hold your Side button until you see Slide to power off. Turn it off and back on again. Done.
Now try opening your Messages app and see if your messages are in the correct order.
3. Hard Reset Your iPhone.
A hard reset ain’t that really hard to understand. Just think of it as how you normally restart your iPhone but with this it clears more of your device’s unwanted garbage memory. (it’s NOT your storage. You won’t lose any of your data).
Sweet. So here’s how you do it:.
If you’re on an iPhone 8, 8 Plus or on iPhone X:
Step 1: Quickly press and release your Volume Up button then press and release your Volume Down button.
Step 2: Then, press and hold your Power button (iPhone 8 or 8 Plus) or your Side button (iPhone X). Hold it until the Apple logo appears on the screen.
Done.
If you’re on an iPhone 7 or 7 Plus:
Step 1: Go ahead and press the Power button and your Volume Down button at the same time. Hold it for at least 20 seconds until the Apple logo appears on the screen.
Done.
If you’re on an iPhone 6S or older:
Step 1: Go ahead and press and hold your Power button together with your Home button at the same time. Hold it for at least 20 seconds until the Apple logo appears on the screen.
Done.
Now once your iPhone has restarted, you can try your Messages app once again to see if it has worked.
4. Reboot Automatic Date/Time Settings.
You might be asking:
“How the heck is changing the datetime has to do with fixing how the Messages appear?”
Well, here’s the thing: I can’t give you a straight up answer for how it works but what I can tell you is that it is a legit solution. According to user erikbock who had the same messages out of order problem posted in the Apple support forums and Apple got back suggesting to do this method.
The user suggested it has worked for him and it solved his iMessages problems.
Here’s how you can do it.
Step 1: Jump into your Settings app and then tap General.
Step 2: Next tap on Date & Time.
Step 3: Now here’s what you do: Do you see Set Automatically? Alright turn off the slider next to it and wait for about 10-15 seconds.
Step 4: Finally, enable the setting back and then check if it has solved the problem.
If that has not worked either then..
5. Toggle your iMessage On & Off.
You tried everything above and you find it still hasn’t worked, but wait there’s on more method you haven’t tried just yet.
This time you’re going to restart your iMessage itself.
Your iMessage can actually be disabled, which doesn’t mean it stops all incoming text messages but instead the text messages you get are not iMessages but instead regular messages (the ones with the green bubbles).
Here’s how you can do it:
Step 1: Go ahead into your Settings app and then tap on Messages.
Step 2: The very first thing on the page you will see is iMessage. All you have to do is just disable this setting by switching off the slider next to it (just like you did in the previous Method 4) and wait for about 10-15 seconds.
Step 3: Finally, enable it back and then jump into your Messages app and check if the problem is fixed.
Done.
6. Reset All Settings
Please back up your iPhone before going through with this method.
This is your last resort. A last ditch effort that will hopefully defeat the annoying problem once and for all.
This method is basically involves you resetting all your settings.
That includes your saved Wi-Fi passwords, dictionaries, Bluetooth connections, Apple Pay etc. every setting you’ve set since the start will be restored back to its factory settings (to how you first got it).
Note
Now remember this does not wipe out all your data (all you Contacts, App Data, Pictures, Notes etc) unless of course if you tap Restore to Factory Settings.
Also if you’re not comfortable resetting your settings then you can bring your iPhone to your nearest Apple Store to get it checked but they will too reset your iPhone (so it’s best to save a few bucks in service charge)
Here’s how you can reset all the settings on your iPhone:
Step 1: Jump into your Settings app and then tap on General.
Step 2: Next tap on Reset.
Step 3: Then once you’re in, tap on Reset All Settings (it’s at the very top). You will be asked to enter your passcode.
Step 4: Finally you will be asked if you’re really sure you want to go through with this. Just hit Reset All Settings and wait.
Once it’s done you can jump into your Messages app to check if it has solved the problem, and it should.
If you've tried all the methods above but you find none of them has worked for you, then the only course of action then would be to just hold on and wait for Apple to address this issue with the next update.
Read more at Saint