Degeneracies between baryons and dark matter: the challenge of constraining the nature of dark matter with JWST