Please check GL_LINK_STATUS (and glGetProgramInfoLog if its GL_FALSE) after linking program. Similar to how you check GL_COMPILE_STATUS after compiling shaders.
My guess would be on one these situations:
1) you are not creating new program - you are reusing previous Shader->ShaderId program, which is already linked, and are attaching new shader objects. I don't remember if this is allowed (need to lookup this in specs), but it may be valid operation.
2) if nr1 is allowed, then it may be because you are attaching new shader objects to existing program, but you are not detaching previous objects. So when glLinkProgram is called the program will contain two entry points for fragment shader and two for vertex shader, which probably is an error. Check GL_LINK_STATUS!
3) something else, like not querying new locations of uniforms, or new attribute locations. Which is not visible in this code fragment.
And please, please use glGetError after
EVERY call to OpenGL function. I'm not joking or exaggerating. Stick it everywhere. Or use GL_ARB_debug_output extension. It will make catching mistakes with GL so much easier and faster. Trust me, it will. Here's how you use both of them:
https://git.handmade.network/snippets/17