To jump right in; Paul and Silas were whipped and thrown into prison chained. Acts 16:16-25.
ALL things have reason, Amen. God Sees ALL. Was there a prisoner to be executed the following day? Brethren to be slain? A person arrested and jailed whose family/friends/colleagues were believers and prayed for such (to hear The Word.) Paul and Silas should have been weary/exhausted/sore (verse 33: “And he took them the same hour of the night, and washed their stripes; and was baptized, he and all his, straightway.”)
Lots to learn here, we are not called on an ‘easy’ road, or led to share with other believers. We are at times led by The Spirit where we would not have gone otherwise. Acts 16:7; learn to ‘hear The Spirit. https://www.openbible.info/topics/being_led_by_the_spirit