You may need to inspect the cord end that fits inside the computer's power socket
and compare it with a new cord in case of damages. The socket inside the computer
is another matter; to address anything incorrect with that side, is a most difficult task.
There is a fairly well documented process of accessing the power supply as seen
in the iFixit.com repair guides for Mac Mini 2014 model computer. I've looked into it.
• Mac Mini - Late 2014 Repair Guide - iFixit:
https://www.ifixit.com/Device/Mac_Mini_Late_2014
So if the power cord itself appears incorrect compared to a new replacement, then
it may be wise to consider the purchase of another cord of correct specification.
My Late 2012 Mac Mini has a similar cord & with a built-in power supply, there isn't a
lot you can do. The repair guide above shows the socket is part of the power supply.
Or would be if you were to cure the issue from that side. I seldom move my Mini once
it's in a working position and turned on; so haven't found an issue with it unplugging.
In any event...
Good luck & happy computing! 🙂