Since unlike the OR model, your sight rail seems below the level of the main rail with the rear sight, you need the Troy front sight made for COMPACT OR LOW PROFILE gas blocks.
It will raise the pivot point, allowing you to fold completely and also properly align with the rear sight.
Troy BattleSight Front Gas Block Mounting M4 - Black
The gas block on M&P15 Optics Ready models is "same plane" as the rear sight. Yours looks to be lower. The gas block specific is made for lower height (than flattop rail) gas block rails. Hope that helps you. Can you exchange it?
Note the taller base...........................................................