The Scottish Government and NHS "are going to get 100%" compliance with the legally binding 12-week treatment time guarantee, Mr Neil told Holyrood's Public Audit Committee.
But it "may not be possible to ensure that there are no breaches of the guarantee", Mr Neil acknowledged.
He rejected Labour claim the so-called guarantee is "a farce", insisting Labour's handling of waiting times in the previous Scottish Government and the present Welsh Government is the actual "farce".
Scottish patients used to wait years for treatments now available in 12 weeks, while waiting times in Wales are "out of control", he said.
Scotland's top health official Paul Gray has said it may not be possible to ensure there are no breaches of the "guarantee", and accepted he is "not fulfilling the will of parliament" by falling short of 100% compliance.
Echoing these remarks, Mr Neil said: "By definition, if a health board is not meeting the treatment time guarantee then they are not meeting the requirements of the legislation."
Committee convener Hugh Henry said: "Do you agree with Mr Gray that it may not be possible to ensure that there are no breaches of the guarantee?"
Mr Neil said: "You're always going to have, in a system that is dealing with the number of patients we are dealing with every year, a very substantial risk.
"In a small hospital where there might be one consultant in a particular discipline and that consultant goes ill for a period of time and does so suddenly, there's always going to be the opportunity and the chance that that will happen."