I generally agree with Alecos +1 answer, in economics you can never know enough math.
However, I would question the usefulness of formally pursuing masters in mathematics. If you are able to complete PhD in economics you should already have some solid foundations in mathematical topics commonly used in economics.
If you take masters in mathematics you will likely learn more than you already know but you will also be forced to repeat many topics. At the same time from job market perspective, MS in mathematics in itself won’t matter as much as your job market paper and rank of your university where you get your PhD. So formally taking the masters in mathematics will not give you much benefit besides learning more mathematics.
If you care solely about your math skills there are better options in my opinion. Consider sitting the math classes at the MS in mathematics at your university (if your university has math department). Usually professors would allow you to sit their classes even without being enrolled in their class. Many would even share with you course resources. In this way you could pick and choose exactly just advanced classes or classes in areas you think you need for your research.
Nowadays there are also quite high quality MOOC math courses often offered by top universities. The only downside that they have is that you don’t have the personal experience but in these times of pandemic you would most likely not get that with masters as well.
To sum it up, I think that you can never go wrong with trying to learn more math if you want to do research in economics. You will always feel that you never know enough math. But at the same time I would question whether the decision of getting masters in mathematics would pass cost benefit analysis.