It can be the lens not communicating with the camera.

Do you have another lens to see if it has the same issue?

The small contacts on the lens and on the camera body can be cleaned by gently rubbing them with a soft cloth or a pencil eraser .... be very careful not to allow any debris to fall into the camera or the lens.

how to fix error 99 canon