I got the same problem. The cause seemed to be that intrafun passes varargin to the function to m inimize, and if the latter function can't handle it, an error is generated.
The workaround I found was to let my function accept varargin as a dummy argument e.g. If my function was f = @(x) x^2, to change it to f = @(x,varargin) x^2. When this is done, the new function can handle the varargin passed in through intrafun, and no error results.