Squaring Off method when both CNC and Intraday trades of a share are done on the same day

What is the correct order of squaring in Intraday trades when the holding of the same share is also sold the same day?

Scenario as happened with me -

  1. Sold 50 shares from holding as delivery @1740
  2. Sold Intraday 100 shares @1746
  3. Sold Intraday 100 shares @1750
  4. Buy Intraday 200 shares @1745

Now, my broker (Zerodha) says first Intraday trade will be squared off in FIFO order. As such, 4th order is squared with 1st order in full, 2nd order in full, and 3rd order partially (50 shares). The remaining 50 in Order no. 3 are treated as Holding Sell trade. While I am of the view that 1st trade should be holding sell, and order no. 4 should be squared off with order no. 2 and 3.

Request the experienced personnel in the forum including Mr. @nithin to enlighten in this case.

Thanks and Regards