There is a trouble shooting process for this outlined in the FSM.
Start with the crank position sensor, test it and move to the next item. You can test the dizzy, plug wires, coil and finally the igniter. I have seen cheap china parts in the ignition cause misfires. On my truck it was a cheap aftermarket igniter. You should also check the wiring harness at the igniter. The coil also grounds via is mounting bracket, all the LHS engine bay grounds besides the starter ground at this location too. In fact there are five grounds in the engine bay on this side and one on the other side. Head RHS back to firewall, LHD head at engine slinger, at coil on shock tower, just below main fuse panel on LHS inner fender, battery and LHS inner fender at batter tray. I have seen plenty of these unhooked by mechanics and never hooked back up again.
Until you have done the trouble shooting process on the ignition system and double checked all the grounds I wouldn’t be checking anything else.
Toyota wiring connections have an o-ring where needed to keep the water out. I have seen these fall out and also just not be there. A lot of years and potentially a lot of people have put their hands on the engine bay.
Cheers