The intention of the Maginot Line was to avoid the attritional battles along the French-German border like in WWI and leaving the French field army with an operational area it was more likely to be able to handle (N. France and Belgium). In that context the Maginot Line was a huge success that worked exactly as intended, the problem was that the field army failed utterly.
The parts taken by the Germans late in the campaign were outflanked and not finsihed. The Germans had put considerable resources in an attack on the Maginot Line, not at least the huge guns/mortars of 50-80cm calibre. Such guns would probably have made at least parts of the fortifications vulnerable, but the guns would themselves be very vulnerable (and few in numbers).
Fortifications are allways vulnerable if you only perform a inactive/static defence, but in case of a German main attack on the Line, the French would not just have sit it out. Their doctrine called for counterattacks, both with air and land forces, and "plugging" breakthroughs faster than they could expand (in the difficult terrain inside the fortified area). This was the kind of warfare the French Army excelled in, but it was totally unprepared for the fast moving operations of Belgium and N. France.
It is not true that the French Army had forgotten how to attack - the offensive, both limited and all-out was an important part of the doctrine, but the French counted on meticolously planned and executed operations utilising massive firepower rather than swift movement, and personal initiative was seen as a threat and not an asset. Had the French field army in 1940 been given time to gain its cohesion my best prediction is that the Germans would have met a meatgrinder. But the French were not given that time - as orders for this or that defensive position or counterattack was issued (by courier) - the German armoured columns already was there (lead and co-ordinated by radio), and the result was complete chaos in the French ranks and disillusion and defaitism quickly spreading from the top to the bottom - of course reinforced by personal initiative not being allowed - so everybody waited for orders that either didn't arrive or were hopelessly out of context. No army could or can survive such a treatment.
I haven't got the numbers here, but from earlier dives into the subject I recall that the Maginot Line was surprisingly cheap, and avoiding its cost wouldn't have bought enough extra field forces (land or air) to put the French in a better position in 1940. Besides much of its cost was labour intensive construction that could not easily be transformed into building tanks or planes - or refined doctrines.
Regards
Steffen Redbeard