Yes, you can write a prepared spell on the Wizard Spell List into your spellbook as described in the Replacing the Book section of the Wizard class, regardless of what class you use to prepare the spell.
Per the description you have provided, with my own emphasis,
Replacing the Book. You can copy a spell form your own spellbook into another book-for example, if you want too make a backup copy of your spellbook. This is just like copying a new spell into your spellbook, but faster and easier since you understand your own notation and already know how to cast the spell. You spend only 1 hour and 10gp for each level of the copied spell.
If you lose your spellbook, you can use the same procedure to transcribe the spells that you have prepared into a new spellbook. Filling out the remainder of your spellbook requires you to find new spells to do so, as normal. For this reason, many wizards keep backup spellbooks in a safe place.
There is no restrictions on which class you have prepared the spell from.
If your DM is particularly strict with the rules, you may get caught on "If you lose your spellbook" and "into a new spellbook". Those are easy to get around, though, by having a party member hide your current spellbook, and then copying the spells into a new spellbook, which could become your backup. You then could copy the spell from the new spellbook into your main spellbook once your party member has given it back to you.
Since this answer seems controversial, I'll try another approach to copying prepared spells from the Cleric class that are also on the Wizard's spell list (an important distinction, since a Wizard can't copy or cast a spell such as Cure Wounds) into the Wizard's spellbook. I'm finding a shockingly small amount of material about this, but let's examine copying spell scrolls.
Per Spell Scroll in the DMG (page 200),
If the spell is on your class's spell list, you can use an action to read the scroll and cast its spell without having to provide any of the spell's components. Otherwise, the scroll is unintelligible.
This would mean that, as a Cleric, you would be able to craft a spell scroll of a spell that is on the Cleric's spell list and the Wizard's spell list. As a Wizard, since this spell is on the Wizard's spell list, you would then be able to copy the spell into your spellbook. I can't tell if your familiarity with your own notation and ability to already cast the spell would allow you to follow the cheaper copying conditions from the Replacing the Book section, or if copying from a scroll and not your own spellbook overrides that ability and forces you to follow the price and time as described in the Copying a Spell into the Book section. Since Cleric spells are Wisdom-based and Wizard spells are Intelligence-based, more DMs may be inclined to follow the more expensive rules, assuming they allow PCs to craft spell scrolls at all.
Per Copying a Spell into the Book of the 53 PHB (page 114), emphasis mine,
When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a level for which you have spell slots and if you can spare the time to decipher and copy it. Copying a spell into your spellbook involves reproducing the basic form of the spell, then deciphering the unique system of notation used by the wizard who wrote it.
The only downside to this tactic is, as is emphasized in the section above, there is an assumption that a Wizard wrote the spell that is being copied. This may just be fluff, though, as using a scroll is not held to any standard of who wrote it, and as such different classes have the ability to use the same spell scrolls if the spells are on both spell lists. So, again, more stringent DMs may not allow this.
However, in practice, creating a spell scroll and then immediately copying what you just wrote into your spellbook seems silly, since you could have just written what you copied to begin with.
Here are some somewhat-related questions I found: