Those were different incidents, iirc he proposed shutting down travel when news about Covid came from China.
The other "closing of the borders" is about immigration laws. I'm not from the US, but I never understood the anti-Trump position there. Surely, if you have immigration laws, you should try to uphold them. You can criticize the laws and try to change them, but criticizing attempts to uphold the laws makes no sense.
A temporary closure in the face of a pandemic is somewhat different than closing them based on his rather colourful view of immigrants.