Hello Uma,
If planned order for X material is firmed then system won't delete it.
Please check the planned in MD04. Also check VBBE table for sales requirement for material X abd Y.
Generally you can solve these inconsistency problems with report SDRQCR21
Please run the MD50 again with Planning Mode as 3 - Delete & recreate
Could you please share the screen shot MD04 for materials X and Y?
Best Regards,
R.Brahmankar