You cannot be denied the benefits on the grounds stated, if otherwise eligible. Section 14, 15 &17 of the Maternity Benefit Act provides for the remedy in this context.
"14. Appointment of Inspectors
The appropriate government may, by notification in the Official Gazette, appoint such officers as it thinks fit to be Inspectors for the purposes of this Act and may define the local limits of the jurisdiction within which they shall exercise their functions under this Act.
15. Powers and duties of Inspectors
An Inspector may, subject to such restrictions or conditions as may be prescribed, exercise all or any of the following powers, namely:-
(a) enter at all reasonable times with such assistants, if any, being person in the service of the government or any local or other public authority, as he thinks fit, any premises or place where women are employed or work is given to them in an establishment, for the purposes of examining any register, records and notices required to be kept or exhibited by or under this Act and require their production for inspection;
(b) examine any person whom he finds in any premises or place and who, he has reasonable cause to believe, is employed in the establishment;
PROVIDED that no person shall be compelled under this section to answer any question or give any evidence tending to incriminate himself;
(c) require the employer to give information regarding the names and addresses of women employed, payments made to them and applications or notices received from them under this Act; and
(d) take copies of any registers and records or notices or any portions thereof.
17. Power of Inspector to direct payments to be made
(1) Any woman claiming that-
(a) maternity benefit or any other amount to which she is entitled under this Act and any person claiming that payment due under section 7 has been improperly withheld;
(b) her employer has discharged or dismissed her during or on account of her absence from work in accordance with the provisions of this Act, may make a complaint to the Inspector.
(2) The Inspector may, of his own motion or on receipt of a complaint referred to in sub-section (1), make an inquiry or cause an inquiry to be made and if satisfied that-
(a) payment has been wrongfully withheld, may direct the payment to be made in accordance with his orders;
(b) she has been discharged or dismissed during or on account of her absence from work in accordance with the provisions of this Act, may pass such orders as are just and proper according to the circumstances of the case.]
(3) Any person aggrieved by the decision of the Inspector under sub-section (2) may, within thirty days from the date on which such decision is communicated to such person, appeal to the prescribed authority.
(4) The decision of the prescribed authority where an appeal has been preferred to it under sub-section (3) or of the Inspector where no such appeal has been preferred, shall be final.
(5) Any amount payable under this section shall be recoverable by the Collector on a certificate issued for that amount by the Inspector as an arrear of land revenue."