40lp and then lost few games -->back to 0
I seriously doubt a couple of losses in Master tier are only costing you few LP.
It also depends if it was in a single day or you've played on 0 LP after a day or two. Master+ has different constraints than D1- and their LP decays faster than the rest of the Tiers. Simply because Master and Challenger are high level competitive tiers and wanting to stay there requires daily ranked effort to prevent you from decaying.
Your account was probably in danger of decaying and the safeguard (instant tier demotion is not possible and you are shielded for a couple of games on 0 LP after reaching a new tier) was removed, so one loss on 0 LP resulted in a demotion to D1.
I honestly don't know if the demotion shielding for Master and Challenger tiers is the same as in D1- but taking into account that this is the high level competitive environment, it might very well be tuned very lightly or it doesn't exist at all.