How do I explain a 3 year gap during MBA interviews? Will it affect my application?

start itself that you had liking for both CA and HR and you went with CA but then when dived deep you found that this is something you don't like to do, you are more a people oriented person and thus doing a HR job would suit you best so it is better late than never.

Be it XLRI or any other renowned college for that matter, They look for your attitude, aptitude not how much gap you have.

It is just a point which might come up during your interviews and that is the only place you need to provide some justification and convince them. In all other evaluation criteria this won't affect at all.

One way is to say that at the start itself that you had liking for both CA and HR and you went with CA but then when dived deep you found that this is something you don't like to do, you are more a people oriented person and thus doing a HR job would suit you best so it is better late than never. But you need to full proof it with ready answers to all cross questions that might come with this. It is just one example. There are various ways to put forth your point and probably better ways. And you yourself would know best because it is your story.