I’ve been in places before where I’ve had no service on my iPhone and Apple Pay has gone through fine.
Likely merchant floor limits, terminal rules or the terminal had a connection.
Of course it works if the device doesn't have an internet connection, all the work is being done by the terminal. That's why it works on Apple Watches that don't have a cellular connection.