The following query throws this exception:
IQueryable nonGenericQueryable = new MyQueryable<Cook>(); foreach (var item in nonGenericQueryable) ;
This causes the non-generic QueryableBase.GetEnumerator() to be called, which in turn invokes the non-generic QueryProviderBase.Execute (Expression) method. That method gets the expected result type from the Expression tree and tries to cast the result to that type. Which does not succeed as the result of Execute is not of type MyQueryable<Cook> (but EnumerableQuery<Cook>).
See also: http://groups.google.com/group/re-motion-users/browse_thread/thread/ed448a3a4dcbfa36.
Override the new public virtual IStreamedData Execute (Expression expression) method instead.
This change was made for performance, to avoid one reflection-based call.