The reading in 𝓟 (in Hyrum Smith’s hand) is obviously defective: “all the trials and troubles a righteous king”. The 1830 typesetter supplied the necessary of; Oliver Cowdery seems to have missed it when he proofed 𝓟 against 𝓞 (unless 𝓞 also lacked it). The of is supported by the semantic equivalence of the following yea-phrase: “yea all the travails of soul for their people”. Another example of “trials and troubles” being postmodified by a prepositional phrase headed by of is found in Alma 36:27: “and I have been supported under trials and troubles of every kind”.
Summary: Maintain in Mosiah 29:33 the obviously necessary preposition of supplied by the 1830 typesetter: “all the trials and troubles of a righteous king”.