Please keep in mind that the buffer is defined using the same distance units as used for your coordinates and is calculated in 2D only. You may wish to transform your geometry, buffer, and then transform the result back when working in real world units such as DefaultGeographicCRS.WGS84.