It's illegal because your insurance is provided to you for being an active employee; taking "unpaid" time off is to go off payroll and effectively be unemployed, so you could no longer be covered under your employer-provided insurance. That's why they could not accommodate you this way.It is not being racist to take actions based on your own actions or statements; you asked for an excessively long amount of time off and tried to get around their statement you could not have the time; for that, they can warn you.