Setting Mesh Colliders convex through script

I keep getting these 2 errors when trying to set convex to true on a procedurally created mesh.

What do they mean and how would I try to fix them?

Well, the error is quite clear: Your mesh most likely doesn’t represent a volume. A 3D convex hull can only be created if the mesh represents a volume. For example when you attach a meshcollider to a default Plane or Quad mesh and select convex you would get a similar error. Make sure your mesh vertices don’t lie in the same plane. To actually be able to form a volume you need at least 4 vertices in your mesh. 3 vertices will always form a plane so at least one other vertex need to be off that plane. The simplest volume is a Tetrahedron / Simplex