Alternative repair. In the troublesome lines

  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
                           (and buf (with-current-buffer buf
                                      default-directory))))
      (not dir))
    (let (shell-dirtrack-verbose)
      (tex-send-command tex-shell-cd-command dir)))

change

   equal dir -> equal "garbage" in the line with unless.

This will force the cd command to always execute.

Here's the patch I made

--- tex-mode.0.el 2020-07-31 16:22:30.380924724 -0700
+++ tex-mode.1.el 2020-07-31 14:00:36.344874591 -0700
@@ -2482,7 +2482,8 @@
     (tex-send-tex-command compile-command dir)))
 
 (defun tex-send-tex-command (cmd &optional dir)
-  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
+  (setq nodir "garbage") ;; dir -> nodir  force a cd  nodir!=dir
+  (unless (or (equal nodir (let ((buf (tex-shell-buf-no-error)))
                            (and buf (with-current-buffer buf
                                       default-directory))))
        (not dir))