Ask for some help about spherical joints in URDF file

Hello there,
I am working with a humanoid urdf and want to use some spherical joints. A problem came out that i found i have to replace all joints using spherical joints, otherwise the simulation result went wrong. For example, if using link → one spherical joint → link → revolute joint → link, the dof is not right.

Looking for some help. Is there anyway to address this problem?

Thanks a lot.