Here's some context from my friend Pierre-Yves Saintoyant:
We would say this, for instance, when cutting or burning your finger when trying to cook, doing some DIY, or hurting yourself in any way while trying a new craft; or suffering and complaining in learning a new process. For instance if you lose all your work because you did not do any backup, someone could tell you “c’est le métier qui rentre” ;-) If you develop some pain (e.g. blisters) while doing some work, someone might tell you “c’est le métier qui rentre” to “comfort” you.
This expression is also used when beginners make mistakes to encourage them to continue (and hopefully improve); someone could tell them “that’s not bad, c’est le métier qui rentre”.