To read the encoder please use GAP 209, <axis> and not GAP 0, <axis> (as this will not read the encoder but the target position of the motor which hasn't got anything to do with the encoder).
For testing the connection between the TMCM-323 and the TMCM-342 you can also try to write something to the encoder position registers and then read it back. For example, try the following commands in direct mode:
SAP 209, 0, 111111
SAP 209, 1, 222222
SAP 209, 2, 333333
Then, also in direct mode, try GAP 209, 0 then GAP 209, 1 and then GAP 209,2. With these commands you should get back the numbers you have put into the encoder position registers in the first step.