As mentioned in comments, you will need to apply for and receive a Swiss work permit (issued by the canton but governed by federal law) before you can work in Switzerland.
There is indeed a requirement to have a valid passport at all times, found at Article 89 of the Federal Act on Foreign Nationals and Integration:
Foreign nationals must be in possession of a valid identity document recognised in terms of Article 13 paragraph 1 during their stay in Switzerland.
Article 13(1) is the article that requires the presentation of a passport when applying for the residence/work permit. For context, here are articles 11 through 13 in their entirety:
Art. 11 Permit requirement for period of stay with gainful employment
1 Foreign nationals who wish to work in Switzerland require a permit irrespective of the period of stay. They must apply to the competent authority at the planned place of employment for this permit.
2 Gainful employment is any salaried or self-employed activity that is normally carried out for payment, irrespective of whether payment is made.
3 In the case of salaried employment, the application for a permit must be submitted by the employer.
Art. 12 Registration requirement
1 Foreign nationals who require a short stay, residence or settlement permit, must register with the competent authority at their place of residence in Switzerland before the expiry of the period of stay not requiring a permit or before they take up employment.
2 Foreign nationals must register with the competent authority at the new place of residence if they move to another commune or to another canton.
3 The Federal Council shall determine the time limits for registration.
Art. 13 Permit and registration procedures
1 Foreign nationals must produce a valid identity document at the time of registration. The Federal Council shall determine the exceptions and the recognised identity documents.
2 The competent authority may require an extract from the register of convictions in the applicant's country of origin or native country as well as further documents that are necessary for the procedure.
3 Registration may only be carried out if all the documents indicated by the competent authority as necessary for granting the permit are provided.
I don't know whether any exceptions exist for people in your situation. You may be able to find out at the cantonal immigration office. A list of these is available on the federal website.
If you can apply successfully for asylum then you can get a refugee travel document under Article 59, but you would need to have a better reason for avoiding military service than simply not wanting to do it.