Should be a bug. But not sure

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.
Only spells on the Wizard list can be learned in this way. Even if the game allowed you to copy a non-Wizard spell into your spellbook, we have in Preparing and Casting Spells, page 30 PHB

You prepare the list of wizard spells that are available for you to cast. To do so, choose a number of wizard spells from your spellbook equal to your Intelligence modifier + your wizard level (minimum of one spell). So even if you could write non-Wizard spells in your spellbook, you couldn't prepare them and therefore couldn't cast them.

Wizards can't use scrolls that are not on their list either, since we have on page 60 of the DM's Basic Rules:

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.