Are there any advantages to getting a masters degree en route to a PhD. Possibly. Suppose you get a masters degree. Get employed professionally, and do a good job. You employer sees benefit in your advanced study, as supports (part of it), monetarily.
In general, if you mean is there any benefit to staying at the same school with no time lapse, etc, there does not seem to be any benefit. About 50 years ago (now), I was told by a former lab manager at a graduate school that when he got out of school with a PhD, he was not getting any jobs. He got the job as lab manager without mentioning he earned his doctorate. He only mentioned he had a masters, and was hired. This was sometime in the late 1960's, or early 1970's though, and I only have his word to take for it. Also, his role as lab manager did not lead to (e.g. a tenure track) teaching position. He claimed, (he thought) he would not have received an offer if the school knew he had a doctorate. I presume many schools require a transcript of ALL graduate work so hiding your full credentials is more difficult. It is likely misrepresentation (even of the higher) credential would be dismissible