Fixed #23621 -- Warn for duplicate models instead of raising an exception

Enables code reloading, e.g. from Python shell.