While I know it can happen, it should not be happening. Can ypu put a print path statement above the line
Code:
res = self._send_validated_command(FreeSpaceQuery(path), timeout=5000) # Timeout needs to be increased as it takes time to read card
and try the command prs500 df