Added a test to ensure bad assignation to M2M doesn't clear data

Refs #14394.