Hi Gimala3,
For help with dictation for Messages, first make sure you're running the latest iOS available. If needed the article here can assist: Update your iPhone or iPad - Apple Support
If fully updated, check your voice control settings and see if the issue occurs when this feature is off. Use Voice Control on your iPhone, iPad, or iPod touch - Apple Support
"How to turn on Voice Control
- Go to Settings and select Accessibility.
- Select Voice Control, then select Set up Voice Control. A download will begin in the background.
When the download is complete, a microphone will appear in the status bar of your device that indicates that Voice Control is listening or not listening."
If the issue remains, reach out to Apple Support directly to report the issue and to further assist.
Contact - Official Apple Support
Contact Apple for support and service - Apple Support
Best.