Try the procedure I described anyway. Can't hurt.
As I understand it, you bought a used Mac that did not contain iMovie on it. If so, you probably will not be able to get iMovie unless you obtain it from another Mac computer or find it on the internet someplace. Downloading from unapproved third party websites is not authorized by Apple and runs the risk of mal-ware. The rules of this forum prohibit us from discussing such procedures.
The problem is that the iMovie version that likely originally was on your Mac was acquired under another person's Apple I.D. Therefore, it cannot be updated or acquired via your I.D. through the available authorized channels.
-- Rich