If one lent to him without a collateral [Levush] and later came to take a collateral from him not at the time of his lending, when the time for payment arrived and he did not pay him [Rashi Bava Metzia 113a], according to Torah law it is forbidden for the lender to take a collateral himself. And if he took the collateral himself, he has violated the negative commandment of "thou shalt not go into his house to fetch his pledge," and one does not receive malkot for this negative commandment [the Rambam, chapter 3 of Laws of Creditor and Debtor] because he is liable for its responsibility and must pay if it is lost [the Ra'avad ibid.], and it is a negative commandment transformed into a positive commandment like the negative commandment of robbery.
The Rambam, of blessed memory, wrote, and this is his wording: If a creditor transgressed and entered the house of the debtor and took a collateral from him, or if he snatched the collateral from his hand by force, he does not receive malkot, for it has been transformed into a positive commandment, as it is said, "Thou shalt surely restore to him the pledge when the sun goes down." And if he did not fulfill the positive commandment within it, such as if the collateral was lost or burned, he receives malkot, and he calculates the value of the collateral and claims the remainder in court. Thus far his words.
And that which he wrote, that it is transformed into a positive commandment from the verse "thou shalt surely restore," even though the plain meaning of the verse deals with one who took a collateral with permission, nevertheless the sages of blessed memory expounded [Bava Metzia 31a] that it refers also to one who took a collateral without permission; see there [and so it appears in Temurah 6a, see there in Tosafot]. However, regarding that which he wrote, that if it was lost or burned he receives malkot, they challenged him, for behold it is subject to repayment, and so the sages of blessed memory said [Makkot 16a] explicitly so [the Ra'avad and Maggid Mishneh].
But in truth it is well-settled, for behold, this is certainly so: if we say regarding every negative commandment transformed into a positive commandment that one is not liable for malkot unless he nullified the positive commandment with an action, you would never find malkot in a monetary obligation in any manner. But the Rambam, of blessed memory, ruled in chapter 18 of Sanhedrin that as long as it is possible to fulfill the positive commandment, he does not receive malkot, but when it is impossible for him to fulfill it, even if he did not nullify it with his hands, he receives malkot [according to the version of the Rif there, that Rabbi Yochanan holds so, and only "fulfilled it and did not fulfill it" is explained as as long as it is in his power to fulfill; see there and in chapter 1 of Na'arah, and not like Rashi].
According to this, certainly in robbery it is always in his power to fulfill, and so too regarding a collateral, if it is worth more than his loan, it is in his power to fulfill because he must return the excess. But when the collateral is not worth more, and certainly when it is worth less than the debt, it is impossible for him to rectify the negative commandment of "thou shalt not go into his house" when the collateral is lost, for behold, he does not need to pay because of his debt that is owed to him; it turns out that the negative commandment was violated and to fulfill it is impossible. And specifically "nullified it with his hands" cannot be said in this case, for at the time it was lost, or even if he destroyed it with his hands, it is not relevant to say he nullified it because it is possible through payments, and afterwards when he does not pay, this is not an action with his hands, but it is also not a fulfillment [and that which the Gemara answers there, that it is possible through payments, it answers regarding that which it challenged, that you find it also in "nullified it and did not nullify it," and so wrote the Ramban in Milchamot at the end of chapter 6 of Shevuot, and see Shach siman 72, subsection 9; and according to what I wrote, even in "fulfilled it and did not fulfill it" you find it when it is worth more than the debt] [see in Bedek HaBayit section 12, starting with the words "the Rambam wrote etc." and it appears that the same law applies etc. and it requires great study].
And that which the Rambam wrote, that it is transformed into a positive commandment, even though regarding a wealthy person it is not transformed into a positive commandment—for the commandment to return the collateral is only regarding a poor person, as it is written, "And if the man be poor, thou shalt not sleep with his pledge"—nevertheless, since regarding a poor person it is transformed into a positive commandment, also regarding a wealthy person he does not receive malkot [Taz]. And even though in every negative commandment transformed into a positive commandment one receives malkot in a place where the positive commandment is not applicable—such as in the case of one who rapes a maiden and divorced her, that if he is an Israelite he returns her and does not receive malkot, and if he is a Kohen he receives malkot, and so too regarding the collateral itself, that if he lost it or burned it he receives malkot—nevertheless, regarding a wealthy person he does not receive malkot, since regarding this wealthy person himself, should he become poor, it is transformed into a positive commandment, and how shall we lash him? Perhaps he will become poor tomorrow and will need to return it to him, and poverty is common, as it is found in the Jerusalem Talmud, chapter 9 of Nedarim, halacha 4 [and with this, all that the Mishneh LaMelech and the Ketzot HaChoshen challenged is well-settled; and what the Tosafot wrote in Yoma 36b is not relevant here, for it is not similar to a standard negative commandment transformed into a positive commandment according to Rashi's explanation there and in Tosafot Chullin 82b starting with the words "one who sows," this is the explanation: since the essence comes for the plain meaning of encroaching on a boundary, only kilayim is included in this, it is impossible for the secondary to be more stringent than the primary; and furthermore, they relied on the second answer, and "from when the river swept it away" is not a difficulty at all, and contemplate this].
אם הלוהו בלא משכון [לבוש] ובא אח"כ למשכנו שלא בשעת הלואתו כשהגיע זמן הפרעון ולא פרעו [רש"י ב"מ קי"ג] מדין תורה שאסור להמלוה למשכנו בעצמו ואם משכנו הוא בעצמו עבר בלאו דלא תבא אל ביתו לעבוט עבוטו ואין לוקין על לאו זה [רמב"ם פ"ג ממלוה] מפני שמחוייב באחריותו וצריך לשלם אם נאבד [ראב"ד שם] והוי ניתק לעשה כלאו דגזילה והרמב"ם ז"ל כתב וז"ל עבר בע"ח ונכנס לבית הלוה ומשכנו או שחטף המשכון מידו בזרוע אינו לוקה שהרי ניתק לעשה שנאמר השב תשיב לו את העבוט כבוא השמש ואם לא קיים עשה שבה כגון שאבד המשכון או נשרף לוקה ומחשב דמי המשכון והשאר תובע בדין עכ"ל וזה שכתב שניתק לעשה מקרא דהשב תשיב אע"ג דפשטא דקרא מיירי במשכנו ברשות מ"מ דרשו חז"ל [ב"מ ל"א] דקאי גם אמשכנו שלא ברשות ע"ש [וכ"מ בתמורה ו' ע"ש בתוס'] אמנם בזה שכתב שאם נאבד או נשרף לוקה הקשו עליו דהא ניתן לפרעון וכן אמרו חז"ל [מכות ט"ז.] מפורש כן [ראב"ד ומ"מ] אבל באמת א"ש דהנה זהו וודאי אם נאמר בכל לאו הניתק לעשה דאינו חייב מלקות אא"כ ביטל העשה בידים לא משכחת לה מלקות בחיוב ממון בשום עניין אבל הרמב"ם ז"ל פסק בפי"ח מסנה' דכל זמן שיש לקיים העשה אינו לוקה אבל כשא"א לו לקיים אף דלא ביטלו בידיו לוקה [כגירסת הרי"ף שם דר"י ס"ל כן רק קיימו ולא קיימו מפרש כל זמן שבידו לקיים ע"ש ובפ"א מנערה ודלא כרש"י] לפ"ז וודאי בגזל תמיד יש בידו לקיים וכן במשכון אם הוא שוה יותר מהלואתו יש בידו לקיים מפני שצריך להחזיר המותר אבל כשהמשכון אינו שוה יותר וכ"ש כששוה פחות מהחוב א"א לו לתקן הלאו דלא תבא אל ביתו כשנאבד המשכון דהא א"צ לשלם מפני חובו שמגיע לו נמצא דהלאו עבר ולקיימו אי אפשר ודווקא ביטלו בידים אין לומר בזה דהא בעת שנאבד או אפילו איבדו בידים לא שייך לומר ביטלו מפני שאפשר בתשלומים ואח"כ כשאינו משלם אין זה מעשה בידים אבל גם קיום אינו [ומה שמתרץ הש"ס שם דאפשר בתשלומין מתרץ על מה שהקשה דמשכחת לה גם בביטלו ולא ביטלו וכ"כ הרמב"ן במלחמות ספ"ו דשבועות ועש"ך סי' ע"ב ס"ק ט' ולפמ"ש גם בקיימו ולא קיימו משכחת לה כששוה יותר על החוב] [ע' בבד"ה סעי' י"ב בד"ה כתב הרמב"ם וכו' ונראה דה"ה וכו' וצע"ג] וזה שכתב הרמב"ם דהוי ניתק לעשה אע"ג דבעשיר לא הוי ניתק לעשה דהמצוה להחזיר המשכון אינו רק בעני כדכתיב ואם איש עני הוא לא תשכב בעבוטו מ"מ כיון דבעני ניתק לעשה גם בעשיר אינו לוקה [ט"ז] ואע"ג דבכל לאו הניתק לעשה לוקה במקום שהעשה אינו ניתוק כמו באונס את הבתולה וגירשה שאם ישראל הוא מחזיר ואינו לוקה ואם הוא כהן לוקה וכן במשכון עצמו שאם איבדו או שרפו לוקה מ"מ בעשיר אינו לוקה כיון דבזה העשיר עצמו כשיעני הוי ניתוק לעשה ואיך נלקיהו שמא יעני למחר ויצטרך להחזיר לו והעניות מצויה כדאיתא בירושלמי פ"ט דנדרים הלכה ד' [וא"ש בזה כל מה שהקשו המל"מ והקצה"ח ומ"ש התוס' ביומא ל"ו: אינו ענין לכאן דל"ד לניתק לעשה דעלמא כפירש"י שם ובתוס' חולין פ"ב: ד"ה הזורע ה"פ כיון דעיקרא אתי לפשטא דהסגת גבול רק כלאים נכלל בזה א"א להיות טפל חמור מן העיקר ועוד דסמכו על תירוץ השני ומשטפה נהר ל"ק כלל ודו"ק]: