Why is 的 mandatory in the sentence 坐四十五分钟的二百七路
二百七路 sounds like  a bus route number. That would make it a noun
的 is acting as the preposition 'of' in this context.  It connects the quantity complement &quot;四十五分钟&quot; to the noun 二百七路 (45 minutes of route 207)

[坐] [四十五分钟] [的] [二百七路]
[ride] [45 minutes] [of] [route 207 (bus)]

Example of quantity complement complements verb:

坐 (v) 四十五分钟 (quantity complement)
坐 (v) 二百七路 (n) 四十五分钟 (quantity complement)

坐四十五分钟的公共汽車 can be reduced to 坐四十五分钟公共汽車 by omitting 的. Which mean 坐四十五分钟的二百七路 can also be reduced to 坐四十五分钟二百七路