I was working in a corporate company in a generalist role. Now I am in a consultancy doing recruitment; is it okay, and will it affect my career?
Why Did You Switch to a Consultancy?
Was it because you wanted to switch profiles from a generalist to a recruiter? If so, you can continue in consultancy for a few months, get a grip on recruitment, and learn all the do's and don'ts of recruitment. Then, you can move back to corporate as a recruitment specialist or core recruiter.
Exploring Different HR Aspects
If, however, you wish to explore different HR aspects (which are not just recruitment/onboarding—there are things like policy making, implementing, maintaining attendance and leave, conducting performance management and appraisals, employee grievance handling, etc.), you need to switch back to corporate ASAP.
People usually start with consultancy when they fail to get a corporate job, so at least they get an experience letter for a switch. You've actually done it the other way around, the reason for which is not understood by me. But I have given you clarity on both things... Hope it helped. All the best