Yes, this happens all the time: nonstop flights from a hub can be more expensive than connecting flights to an outstation through the same hub. Though it's surprising to me that JFK exhibits this behavior. Google Flights and ITA Matrix are great tools for finding similar deals.