Why does dictation on my MacBook Pro record my words fine but not on my iMac?
If it's different between two machines, the most likely issue is the microphone. Are you using the built in Mic on the iMac? If so, try an external one. Also take into account any noise sources around your iMac such as fans, air conditioners, etc.

The other possibility is that you're just getting bad luck with the dictation service. Because it's dependent on Apple's servers, the results can be spotty if load happens to be very high. But if it's happening at different times of the day, chances are it's a microphone issue.