Strange behavior when using Protothread Library and Arduino Serial library

First, I want to make clear that answering this question may require comprehensive knowledge of the protothread library (which isn't actually that complex) and the Serial library as well as timers. Also, I'd like to apologize in advance for the shoddy state of my code.

Dev Context / Environment:
Arduino Uno v3
VSCode with PIO Extension
[Fingerprint sensor](Green Light Optical Fingerprint Reader Sensor Green Light Optical Fingerprint Reader Sensor Module for Arduino Mega2560 UNO R3 FZ1035G) with Adafruit fingerprint sensor library
Ben Artin's protothread library


    static unsigned long timer1;                        \
    timer1 = millis();                                  \
    static unsigned long timer2;                        \
    do                                                  \
    {                                                   \
        if (!(((COND) || millis() - timer1 > TIMEOUT))) \
        {                                               \
            timer2 = millis();                          \
            Serial.print(""); //why is this required?   \
            LC_SET((pt)->lc);                           \
            if (!(millis() - timer2 > DELAY))           \
            {                                           \
                return PT_WAITING;                      \
            }                                           \
        }                                               \
        else                                            \
        {                                               \
            break;                                      \
        }                                               \
    } while (1);

/*** see github link at bottom for all code ***/

Example use:

static struct pt statePT; //protothread struct
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
int p = -1; 

PT_WAIT_UNTIL_WITH_DELAY(&statePT, (p = finger.getImage()) == FINGERPRINT_OK, 500, 5000);

Expected behavior:
The fingerprint sensor will sample at a rate of 500 ms over the duration of a 5000 ms period. In simpler terms, the sensor will flash green every 500 ms over 5000 ms.

Resultant behavior:
Perfect! However, if I remove the Serial.print("") statement in the macro, then the fingerprint sensor samples continuously over the 5000 ms period - the sensor stays lit green for the full duration.

Rudimentary debugging:
It seems like the print statement needs to be below the timer2=millis() line - moving it into the if statement causes the bad behavior explained above. If I move it above the timer2 = millis(), the same continuous sampling behavior is seen.

I thought it might be related to the fact that Serial.print is an interrupt-based call (please correct me if I'm wrong), so I tried swapping it out with a delay(1) but, sadly, the same bad behavior happened. I also tried throwing in junk code (int x = 1, and such) in case it had to do with the line number, but that also failed to get the desired results.

My guess is it has to do with the timer. I have a hard time believing it's a compiler issue since those are pretty rare.

TLDR: It seems like there's a strange interaction between the Serial library and the protothread library that causes my code to work. I think it's an interesting puzzle and I hope we can all learn from it!

**Here's the link to all the code. **
Macro definition.
Macro use.

Again, sorry for all the unused variables and the spaghetti code.