The phrase ilā al-masjidi is prepositional (genitive after ilā), not a direct accusative object. A verb can take other complements and still be intransitive directly.
Opening interactive controls...
Not Every Dependent Is an Object
Intransitive and Transitive Verbs: One, Two, Three Objects
The phrase ilā al-masjidi is prepositional (genitive after ilā), not a direct accusative object. A verb can take other complements and still be intransitive directly.