We present a detailed analysis of the reliability of abundance and magnetic maps of Ap stars obtained by Zeeman Doppler mapping (ZDM). It is shown how they can be adversely affected by the assumption of a mean stellar atmosphere instead of appropriate ‘local’ atmospheres corresponding to the actual abundances in a given region. The essence of the difficulties was already shown by Chandrasekhar’s picket-fence model. The results obtained with a suite of Stokes codes written in the Ada programming language and based on modern line-blanketed atmospheres are described in detail. We demonstrate that the high metallicity values claimed to have been found in chemically inhomogeneous (horizontally and vertically) Ap star atmospheres would lead to local temperature structures, continuum and line intensities, and line shapes that differ significantly from those predicted by a mean stellar atmosphere. Unfortunately, past applications of ZDM have consistently overlooked the intricate aspects of metallicity with their all-pervading effects. The erroneous assumption of a mean atmosphere for a spotted star can lead to phase-dependent errors of uncomfortably large proportions at varying wavelengths both in the Stokes I and V profiles, making precise mapping of abundances and magnetic field vectors largely impossible. The relation between core and wings of the Hβ line changes, too, with possible repercussions on the determination of gravity and effective temperature. Finally, a ZDM analysis of the synthetic Stokes spectra of a spotted star reveals the disturbing differences between the respective abundance maps based on a mean atmosphere on the one hand, and on appropriate ‘local’ atmospheres on the other. We then discuss what this all means for published ZDM results. Our discussion makes it clear that realistic local atmospheres must be used, especially if credible small-scale structures are to be obtained.