You constructed your own main_AFO file.m file, probably based upon the main1.m in the File Exchange contribution.
The main1.m source code has
[lb,ub,dim,fobj] = Get_Functions_details(option.F);
I suspect that you instead did
but that you instead should have done
Unfortunately once again someone has asked us to debug code without providing us with a copy of the code, so we can only guess about the details.