Its impossible to gain expert level knowledge in all the feilds related to the project. So as a UX designer you need to find and talk to domain experts. Then try to narrow down on their problem you are trying to solve. And then try to come up with solutions that solve the problem. To do this you will have to ask the right questions to the right stake holders and domain experts and professionals in the feild.
Also when you are trying create a UX solution for a niche domain, you have to start testing your solutions as early as possible so that you will know what works, what does not work.
Also, being a UX designer, the project owners know that your experitise is not the same as theirs. So you can easily tell the stake holders that you will need their help to solve the problem. Because they are the SME or Domain experts. And if you can ask for help, they will feel their problems are being heard and in most situations, you will get their whole-hearted support.