Thanks for reaching out to the Apple Support Communities! It sounds like you are having issues with Dictation not working properly. First, try toggling Dictation off and then back on by going to Settings > General > Keyboard > Enable Dictation. Turn the option off (grey) then back on (green) and test to see if the issue is still going on.
Next, check out this article with steps to Force an app to close on your iPhone, iPad, or iPod touch . This will allow you to close the Messages app. Also, check out this article with steps to Restart your iPhone, iPad, or iPod touch and test it out again.
Have a great day!