Trying to replace an asset via replaceFile action in entry form
In short, you have the right idea, but you're not uploading any files with that JavaScript. All you're doing is sending a file id to a Craft action that expects an uploaded file as well.

You can find an insight on how to change your javascript to include file data as well here