The prophetic mode does not necessarily produce chronological accuracy. Therefore, there is no reason to expect that the Jews’ belief in Jesus as the Messiah will precede the “marvelous work and a wonder.” Both are separate elements in the prophecies to be fulfilled. Each comes in its own time and order. The “second time” begins with the restoration of the gospel through Joseph Smith, but when was the first time? I suggest that Nephi is applying language typically reserved for one eschatological function to another. The typical usage of restoration in Isaiah and Nephi is to describe the reuniting of scattered Israel as part of the last days. This is part of the work that begins when Yahweh “set[s] his hand again the second time.”
In verse 17, however, the people are not being restored to a location, but rather are being restored to a state of righteousness. Nephi is asserting that the first time Yahweh attempts to restore this righteousness will be when Jesus is born in Jerusalem. That attempt will see the Messiah’s crucifixion. Thus, there will need to be a second time when the Jews are to be restored to righteousness through access to the true doctrines of the Messiah. The second time will be a “marvelous work and a wonder,” the restoration of the gospel in the latter days.
To understand how Christ’s earthly mission is a “restoration,” it is important that we see Nephi’s vision of the Atoning Messiah in his terms rather than our own. When Nephi uses the term “restore” in the context of realigning Israel with Yahweh, he places his vision of the future precisely parallel to that of Isaiah. Isaiah’s prophecies include a Messiah, but they include a presumably Jewish Messiah whose mission is to restore the house of Israel to its proper position before Yahweh.
Nephi sees Jesus’s mission on earth not in terms of separation (such as the scattering of people from their homeland), but of repentant healing. Where the Christian world views itself as separate from Judah, and perhaps sees the mission of Jesus as establishing a division (a new covenant that would pass the glory of the chosen people from the lineage of Judah to the separate community of Christian believers), both Isaiah and Nephi see the Messiah as a reformer of Israel: one who does not divide but who brings back or restores Israel’s honored position.
Reference: The phrase “marvelous work and a wonder” quotes Isaiah 29:14. Nephi is positioning his words (and by extension, the entire Book of Mormon) as fulfilling Isaiah 29:11–14. He again picks up this thread connecting the future of his book to Isaiah’s prophecy (Isa. 29) in 2 Nephi 26:16.
Narrative: In Nephi’s first recounting of this vision, he notes: “For the time cometh, saith the Lamb of God, that I will work a great and a marvelous work among the children of men” (1 Ne. 14:7; emphasis mine). The context of that marvelous work is the restoration of the gospel in both recountings of the vision.