"This personal word to Zerubbabel has been left on record for the encouragement of God's children in every age. God has a purpose in sending trial to His children. He never leads them otherwise than they would choose to be led if they could see the end from the beginning, and discern the glory of the purpose that they are fulfilling. All that He brings upon them in test and trial comes that they may be strong to do and to suffer for Him. PK 578.1"
"And we know that all things work together for good to them that love God, to them who are the called according to his purpose."
Both passages address the idea that God uses trials for the benefit of those who love Him. The EGW passage emphasizes that God's purpose in sending trials is to strengthen His children, which aligns with the theme of Romans 8:28 that all things work together for good.
The messages delivered by Haggai and Zechariah roused the people to put forth every possible effort for the rebuilding of the temple; but, as they worked, they were sadly harassed by the Samaritans and others who devised many hindrances. On one occasion the provincial officers of the Medo-Persian realm visited Jerusalem and requested the name of the one who had authorized the restoration of the building. If at that time the Jews had not been trusting in the Lord for guidance, this inquiry might have resulted disastrously to them. “But the eye of their God was upon the elders of the Jews, that they could not cause them to cease, till the matter came to Darius.” Ezra 5:5 . The officers were answered so wisely that they decided to write a letter to Darius Hystaspes, then the ruler of Medo-Persia, directing his attention to the original decree made by Cyrus, which commanded that the house of God at Jerusalem be rebuilt, and that the expenses for the same be paid from the king's treasury. P…
"But the eye of their God was upon the elders of the Jews, that they could not cause them to cease, till the matter came to Darius: and then they returned answer by letter concerning this matter."
Ellen White directly references Ezra 5:5 in this passage.