"And indeed, those who do not believe in the Hereafter are deviating from the path," meaning: they are abandoning it.
﴿وأَنَّ الَّذِينَ لَا يُؤْمِنُونَ بِالآخِرَةِ عَن الصِّرَاط لناكبون﴾ أَي: تاركون لَهُ.