May I assume your using the official Samsung Fold sPens.
You could try the following >
Also this is a tip from a Google Search below >
Hold the S Pen close your your Z Fold3, then press and hold the S Pen's pairing button for three seconds until a pop-up recognizing the accessory appears on the screen. Select Connect to accept the connection.
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I'm here to help. " This is the way. "