Why this isn't second preimage resistance?
Using the hash function;
$$h(M) = \operatorname{AES-Enc}\big(M[0\ldots n], M[(n+1)\ldots 2n]\big) \oplus M[0\ldots n]$$
One can find many pre-images with the given hash value $h$

take arbitrary $M[0\ldots n]$
calculate $x = M[0\ldots n] \oplus h$
Decrypt AES with the key $M[0\ldots n]$ and the ciphertext is $x$
$$m =\operatorname{AES-Dec}\big(M[0\ldots n],x\big)$$

let $M[(n+1)\ldots 2n] = m$ then we are done, found a pre-image. Now if the founded pre-image is different than the provided $M$ with the $h = h(M)$, then this is a second pre-image for the hash function. If not, one can look for others to find a secondary image for this hash function. Therefore, this is neither a pre-image resistant nor second pre-image resistant hash function.
We just used the property of AES that is a permutation under a key and the key is free to the attacker.