So, said at the end of the verse Yusuf 12:35 ⧉ was:
ثُمَّ بَدَا لَهُم مِّن بَعْدِ مَا رَأَوُا الْآيَاتِ لَيَسْجُنُنَّهُ حَتَّىٰ حِينٍ
Later on, even after having seen the signs, they [ the ` Aziz of Misr and his advisers ] deemed it proper [ or expedient ] to imprison him for a time.
Thus, to the prison he was sent.