Fixed #17946 -- Fixed deserialization for self-referencing M2M fields

Thanks Philip Mountifield for the report and analysis.