Why is my camera unable to focus sometimes ?
Some lenses are slower than the others. However, there could be a few possibilities. The lenses generally are unable to focus on plain and smooth surfaces. Shift it to an edge with more contrast and it will focus. Then you can recompose the frame without lifting the finger from the focusing button. This locks the focus as long as you do not lift the finger and press the focusing button again.
If the light levels are very low, most of the lenses would have difficulty at focusing. Superior lenses will be better off compared to cheaper ones. fats lenses ( with more opened apertures) would be better at focusing compared to slower lenses.
Also remember that the middle focusing point is fastest compared to the ones on the sides.
Also ensure that you are not focusing too close to the subject which is at a distance less than the minimum focusing range of your lens.