AIC-based model-selection converges to zero error in the limit, and also has finite-sample convergence that is rate-optimal with respect to worst case minimax error [1]. (Note that AIC refers to Akaike Information Criterion)
However, AIC relies solely on the number of parameters in the model to assess/penalize model complexity. And yet models can have infinite representational capacity even with just 2 parameters, as measured by VC-dimension [2], e.g. {sign(sin(ωx + θ) : ω}. So this infinite VC model can act as a lookup table and perfectly overfit the data, while only having 2 parameters in the penalty term, so it would have low AIC, but no guarantee of low error out-of-sample.
I'm assuming that the issue is that the AIC convergence theorems don't apply to all models, and in particular perhaps these infinite VC-dimension models violate one of the assumptions. But at least based on the papers I've looked at so far it's not clear to me what assumption that might be (if any)?
By the way, according to this review article [1] the convergence theorems apply quite broadly e.g.:
When the true model is not in the candidate model set the AIC is efficient, in that it will asymptotically choose whichever model minimizes the mean squared error of prediction/estimation... The AIC's minimax rate of convergence in risk (and the BIC's lack of it) is a highly general result in regression and density estimation, and holds under more general circumstances than required for consistency properties discussed above. For example, the AIC is minimax-rate optimal regardless of whether the true model is finitely or infinitely dimensional; it is optimal whether the true model is among the candidates or not; and it extends to highly non-linear models, such as functions defined in Sobolev spaces
[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3366160/
[2] http://www.cs.huji.ac.il/~shashua/papers/class11-PAC2.pdf