Mesh with procedurally generated vertices not rendering in a prefab -- why!?

I really need some help understanding why my mesh with procedurally generated vertices doesn’t work in prefabs. I have this setup:

- TextMeshPro
- Quad```

The GameObject has my script ```TextWithBackgroundController```, which holds a reference to the TextMeshPro and the Quad. In its `Update`, it changes the Quad's vertices via ```quad.GetComponent<MeshFilter>().mesh.vertices``` in order to create a background for the TextMeshPro. This works perfectly in both play and edit mode.

Now, I'd like to make a prefab out of these three objects. When I do so, and spawn a new instance of that prefab, the mesh doesn't render at all. The debugger shows that the vertices are set correctly, but that there are no triangles.
I can fix the issue by manually going into the new Quad, and changing the mesh from "Quad" to "Quad Instance" in the mesh filter component.

I don't get it at all. Why does the prefab not render? Why does the mesh not get saved in the prefab? Why does changing the mesh manually fix the issue?

The source code for my script is here: https://gist.github.com/vittorioromeo/d500c347465f5cc3555001d00a1dd6cc

Here's a video showcasing the issue:
https://i.imgur.com/DLPpNJD.mp4

This is really driving me nuts, I don't understand this behavior at all.

Bump