You can't ssh from your phone to your Mac when using mobile data because you are no longer on the same network, and thus can't use the internal (RFC1918) address to reach it.

When you're using WiFi, it works because you _are_ on the same network.

In order to reach your computer when using mobile data on your phone, you must do BOTH of:

 1. ssh to your computer's _public_ IP address; and
 2. Forward port 22 from your home router to the computer you want it to reach.