Was failing because of a mismatch between RNA and DNA defaults on `courant_target` property, removed RNA one (DNA came from initial value defined in BKE's particle creation code, think it's best to keep that one).
make format
BKE_mask_copy_nolib()
BKE_mask_free()
BKE_id_copy_ex
BKE_<id_type>_copy