I don't understand this semantic shift, because a misdeed differs from a penalty or "something to which the right is lost through a misdeed". Can someone please fill in the gap?
A forfeit was originally a ‘transgression’ or ‘misdemeanour’. The word comes from Old French forfet, a derivative of the verb forfaire or forsfaire ‘commit a crime’. This was a compound formed from fors- ‘beyond (what is permitted or legal)’, which is descended from Latin forīs ‘outdoor, outside’ (source of English forest and related to foreign), and faire ‘do, act’, which came from Latin facere (whence English fact, fashion, feature, etc). The etymological meaning ‘misdeed’ was originally taken over from Old French into Middle English (‘Peter was in hand nummen [taken] for forfait he had done’, Cursor mundi 1300), but by the 15th century it was being edged out by ‘penalty imposed for committing such a misdeed’.
Word Origins (2005 2e) by John Ayto, p 226 Left column.