Three people are walking on a beach.
People are swimming in the ocean.
Walking and swimming are two different actions.   The beach is on land, in the ocean refers to actually being I'm the water.
People walking on a beach are not swimming in the ocean.
You can't be swimming and walking at the same time.