I thought I’d post an update for others who may suffer from the same issue in the future.
I tested my plugin in Ableton and it worked fine. This seems like a Reaper bug (the DAW I normally use).
I had to put a flag in visibilityChanged() to trigger a setSize in my timercallback(). And then it resized at the appropriate moment when it was reopened.