Hi,
We would not have the same behaviour since the connection is not closed in state 3 if we send a CKE message but it is closed in state 4 if we send the very same message.
However, Mealy Machines are defined in such a way that we always send one input in each transition.
This is essentially a problem in how we define our input alphabet.
Of course, we could always define a symbol which sends a CCS and FIN message, but this is not the case in this task.
Cheers,
Sebastian