This question is about real situation and I do not say anything about the field of research or any name. Also, I do not have any special opinion. I just want to say a real story and know the experts idea about this subject. Also, maybe someone experienced same situation and did some valuable work. I am so eager to hear the experts story.
Suppose you are a faculty member of a math department in a university. In this university we have the rule "publish or perish"; I know at least one such university, so the supposed set is not empty.
You are working on a special branch in a special field of mathematics which publishing paper is so difficult. Also, working on this topic is long term project which may have significant implications and results.
Parallel to this scenario, you are going to fire since you did not have sufficient number of publications.
In the other group in this department the situation is heavenly. They publish many papers since in their field publishing is so easy and there are a lot of Q1 journals for submitting and getting accept. You can spend several months with this group and learn this branch. Also, you can publish enough (as do not fire) with the team work.
But, the problem is that this field is not in your interest and your contribution to published paper is so weak.
What shall you do? Does The end justifies the means?
Comment: Finding another job (to working on your problem independently)is so difficult!
Any ideas and guidance will be appreciated.