I am trying to solve a linear elasticity model using finite element discretization in a rectangle domain [0,1]x[0,1]. For the solution of the the linear system $Ku=F$ I am using the CG algorithm. However, I have noticed some weird behaviour of the algorithm. For small grids (e.g 2x2 or 3x3 or 2x1 ...) the algorithm fails and doesn't converge while if the grid becomes larger(10x10 or 25x25 ...) the algorithm converges and the results seem reasonable.My first thought was If the application of homogeneous BC leads to an ill-conditioned matrix ,since I zero the columns and rows accosiated with BC and put 1 in diagonals, but this make no sense if the algorithm converges for some grids right? Any idea why is this happening?