The gateway error wouldn't be part of option 125 I believe.
It is part of option 3 (router).
What if you just set static gateway on the phone?
It's frustrating that words like "gateway" and "trunk" are used willy-nilly to describe different things.
I thought this error might be using the word "gateway" in the context of where the handset is registering, but as you say, it could just as well be referring to the router address.
Either way, if it's only happening for 3 devices, it's probably neither of these issues...
I notice from your option 125 that you are not assigning the phone to a VLAN via DHCP.
Does this mean your phones are on untagged switchports?
Could it be that those 3 phones are patched to switchports that have a different config?
Still, if it works with IP address set statically, that seems unlikely.
I'd swap the phone with another one that is always fine and see if the problem follows the handset, or stays with the connection.