'inconsistency detected, please notify mne_python developers' using mne.viz.plot_alignment

MNE Version 1.6.0
Operating system: Windows 10 Pro

I have been trying to visualise my own custom placed EEG sensors using mne.viz.plot_alignment. In this case, I have copied the locations from an example layout. when I try to visualise this layout I get the following error message:

RuntimeError: info channel name inconsistency detected, please notify mne-python developers

Here is my code:

import mne
from mne.datasets import sample
import numpy as np

data_path = sample.data_path()

# the raw file containing the channel location + types
sample_dir = data_path / "MEG" / "sample"
raw_fname = sample_dir / "sample_audvis_raw.fif"
# The paths to Freesurfer reconstructions
subjects_dir = data_path / "subjects"
subject = "sample"

# The transformation file obtained by coregistration
trans = sample_dir / "sample_audvis_raw-trans.fif"

details = mne.io.read_info(raw_fname)

fs=10000
ch_names=[f"EEG{n:03}" for n in range(1,61)]
ch_types=["eeg"]*60
custom_sensors = mne.create_info(ch_names, ch_types=ch_types, sfreq=fs)
custom_sensors['chs'][0:60]=details['chs'][315:375]

mne.viz.plot_alignment(
    info=custom_sensors,
    trans=None,
    subject=subject,
    dig=True,
    meg=["sensors"],
    subjects_dir=subjects_dir,
    surfaces="head",
)

↑↑↑ here you are directly editing the contents of the info["chs"] object. That is almost certainly the source of your problem. If you just want to extract the EEG channels from the info that comes with the sample data, you can do:

mne.pick_info(details, mne.pick_channels_regexp(details.ch_names, r"^EEG"))

…but you say you want to visualise your own EEG sensor locations… I don’t see where in your code sample you are loading or specifying what those custom locations are? For that you’ll probably want mne.channels.read_custom_montage — MNE 1.6.1 documentation