As both @Dimitris Rizopoulos and @Jeremy Miles say, it is possible to fit an SEM using categorical data (i.e., which includes your dichotomous and ordinal variables). There are generally two methods used to go about doing this$^1$. The first is the direct method, which treats categorical data as continuous and, as a result, estimates model parameters using the sample correlation/covariance matrix. The second method goes by many names, but here I will refer to the underlying latent response method since it invokes the presence of an underlying latent response/variable through the use of tetrachoric/polychoric correlations to estimate model parameters. Below is some code for fitting your model using each method
## Lavaan Model
# Note model is the same across both methods.
model <- '
socio =~ x1 + x2 + x3
eco =~ x4 + x5 + x7
eco ~ social
'
## Fitting models
# Fit using the direct method
fit1 <- sem(model, data=dataset2)
# Fit using the underlying latent response method
fit2 <- sem(model, data=dataset2, ordered = colnames(dataset2))
So, to answer your first question, yes, SEM models may be fit using dichotomous and/or ordinary data, and there are multiple ways to do so (for more information, see Wirth & Edwards 2007).
Regarding whether the categorical nature of your data is related to your convergence issues, I agree with @Jeremy Miles that we need more information to answer this question. One possible reason for this I can think of from reading your question is that it could be related to your data. Variables such as employment and gender in particular, are seldom used as indicator variables in latent variable models. While such variables likely display meaningful bivariate associations (e.g., I am sure all variables load onto the socio have meaningful bivariate associations), I am not sure whether a measurement model is a correct way to account for dependencies between variables that load onto the same latent construct. Put differently, it may be a better idea to use something like path analysis to test the relationships among x1-x6, instead of using a SEM$^2$.
$^1$Note that within each method, there are still important decisions to make, such as the choice of estimation method. For more information on this, see Wirth & Edwards 2007.
$^2$ Note that path analysis is simply SEM without the measurement model, and therefore can be estimated using most (if not all) SEM software packages such as lavaan
and mplus
.
References
Wirth, R. J., & Edwards, M. C. (2007). Item factor analysis: current approaches and future directions. Psychological methods, 12(1), 58.