Could it be water in the fuel?
I had a similar issue on a previous boat....would run but wouldn't idle.
The cause was a small amount of water in the fuel because I had left the boat in Fiji over the cyclone season and the #2 fuel tank was empty.
The condensation from the high ambient humidity contaminated the fuel when I filled it.
Solution was to empty the tank, clean it, refill, bleed the fuel line and injector pump and presto, all go again.