Here the printer’s manuscript reads wrecked, apparently an error for racked. The 1879 LDS edition made the emendation to racked for the LDS text, while the RLDS text has retained the earlier wrecked. This error probably occurred as the scribe in 𝓞 (presumably Oliver Cowdery here) mixed up /rækt/ with the phonetically similar /rekt/ as he took down Joseph Smith’s dictation. It is also possible that the error occurred when Oliver copied from 𝓞 into 𝓟, especially if racked had been misspelled in 𝓞 as wracked. There are no extant examples of Oliver misspelling rack as wrack in the manuscripts. But we do have five examples of him misspelling rent as wrent, so the misspelling wrack for rack is theoretically possible. In any event, the verb or noun wreck never occurs in the Book of Mormon text (or in any of the scriptures, for that matter). On the other hand, in parallel passages in Alma 36, when Alma later explains these same events to his son Helaman, the text consistently uses the verb rack to refer to the torment that Alma suffered:
There are also two other occurrences of the verb rack in the text:
Clearly, the occurrence of wrecked in 𝓟 for Mosiah 27:29 is an error for racked.
Summary: In Mosiah 27:29, the original text undoubtedly read “my soul was racked with eternal torment”; most probably, the scribe in 𝓞 (presumably Oliver Cowdery) misheard Joseph Smith’s dictated /rækt/ as /rekt/ and thus spelled this verb form as wrecked, which was then copied as such into 𝓟 and ultimately into the 1830 edition.