I learnt that modifiers are optional and can be omitted in a sentence by which the sentence still makes sense
That's almost right. Leaving out the 'extra information' or 'middlemen' (modifiers) is a great way to check if a subject and verb match up. However, the extra information is information and adds something to the sentence. So we'll often end up with a sentence that is grammatically okay, but doesn't make a lot of sense. For example, this is a correct sentence: 'Stacey, along with her friends, often goes to the beach on the weekend.' If I leave out all the modifiers, then I just get 'Stacey goes'. This doesn't make a lot of
sense, but it passes the test of
correct subject-verb agreement.
Now, we have to be careful what is extra information (a modifier) and what is part of the core subject-verb relationship of the sentence. That's where you're going wrong in your analysis. Let me try to list the many modifiers here:
"A New York City ordinance of 1897 regulating the use of bicycles, mandated a maximum speed of eight miles an hour, required of cyclists to keep feet on pedals and hands on handlebars at all times, and granted pedestrians right-of-way."
'New York City' describes the ordinance
'of 1897' gives information about the ordinance
'regulating the use' information about the use
'of bicycles' more information about the ordinance
'a maximum speed of eight miles an hour' information about what was mandated
'of cyclists to keep feet on pedals and hands on handlebars' information about what was required
'at all times' information about keeping feet on pedals and hands on handlebars
'pedestrians right-of-way' information about what was granted (the object of the verb)
Therefore the core of the sentence is 'A[n] ordinance mandated, required, and granted.' Here we've got a subject and a list of three verbs. Again, this doesn't make a lot of
sense to me, but it's okay grammatically.
The key question is: 'what is a modifier and what is part of the core?'. For this you need to recognize the various modifiers: prepositional, -ing, which, that, etc. You also need to see that 'mandated' is a verb in this context and can't be left out.