Incorrect subnetmask/gateway, ping local vs ping remote

in CCNA & CCENT
I've seen this a couple of times, but if the subnetmask/gateway is incorrectly configured, you can't ping a host from a remote network, but it does reply when pinging from the gateway itself.
I'm trying to wrap my head around as to how the ping works when pinging directly from the gateway, vs a few hops away, where in the ping process does failure happen? Can someone explain this to me?
I'm trying to wrap my head around as to how the ping works when pinging directly from the gateway, vs a few hops away, where in the ping process does failure happen? Can someone explain this to me?
Comments
Going to update this, as I think I misunderstand the question here. The scenario I drew up in my head will not apply here and is no good, because the default gateway will not respond to a ping from 192.168.1.200 if the router itself is 192.168.1.1/25. If the router was set to /24 and the host was set to /25, but with an IP address inside the lower half of the range, it would still reach the default gateway, but that hypothetical missing route from the remote router would not occur.
I would like to elaborate on network's post further, because he is on the right track and I was going down the wrong trail. If a host is incorrectly configured for 192.168.1.200/8 when it should be a /24, the host is going to be thinking 192.X.X.X is on the same subnet and try to ARP for this unsuccessfully rather than directing a ping at the IP address of the remote host with the default gateway as the layer 2 destination.