Off-by-one error when mapping Ensembl IDs to gene symbols
There’s no 1:1 mapping between the IDs of different database schemas. As a consequence, some Ensembl gene IDs map to multiple MGI symbols, or to none (and vice versa).

Therefore, you can’t assume that the number of result rows will be equal to the number of query IDs.