Remember you need a visa to transit in Saudi Arabia.
I don't think you'd be able to route XXX - DMM/RUH - JED - JFK without a visa to actually enter Saudi. I'd be very surprised indeed if the transit visa allowed you to do that. Flying domestic into JED allows you to walk out of the airport without challenge, which they will not want you doing if on a transit visa.
EK fly DXB-JED if that's a valid routing.