The assert indicates that both bodies are not dynamic.
Make sure you don't change the dynamic property of bodies to NO (use bitmasks to exclude them from colliding). Definitely don't do that within the contact callback methods because it looks like this assert happened during the contact collision solving step. It seems logical that two static bodies can only be in contact and trying to resolve collision when one of them was initially dynamic when contact began.