I think I found it. Maybe I was wrong about it coming from んです, this makes more sense:
https://japanese.stackexchange.com/questions/94529/why-does-ru-turn-into-n-at-times
“ This is not a conjugation: this is an abbreviation or contraction that happens due to the sounds involved and the biomechanics of the shape of the mouth when articulating these sounds.
This is similar to the process by which English “do not you…?” becomes “doncha…?”, or *“did you eat yet?”*becomes “jeechet?”, or *“I am going to…”*becomes “I’m’a …”.
Note that, in Japanese, the ~る ending only collapses to ~ん when the conditions below are met:
- the following sound starts with an /n/, such as な or の
- For instance, you won’t see すんひと as a contraction for するひと. The phonology is wrong, since ひと doesn’t start with /n/.
- the context is informal speech
- For instance, you won’t see すんの as a contraction for するの in formal writing, and you won’t hear it in formal speech. “