The sextic oscillator adapted to the Bohr Hamiltonian has been used to describe even Pt and Os isotopes from $A=$188 to 198 and $A=$186 to 192, respectively. The purpose of this study was investigating the possible transition from the $\gamma$-unstable to the spherical vibrator shape phases. In this setup the potential appearing in the Bohr Hamiltonian is independent from the $\gamma$ shape variable, and the physical observables (energy eigenvalues, $B(E2)$) can be obtained in closed analytical form within the quasi-exactly solvable (QES) formalism for the model space containing 30 of the lowest-lying levels. Experimental energy levels have been associated to the theoretical ones. The available electric quadrupole transition data ($B(E2)$, decay preferences) have been taken into account in matching the experimental and theoretical levels. Special attention has been paid to transitions from the first two excited $0^+$ levels to the $2^+_1$ and $2^+_2$ levels, as these indicate the change of shape phases with spherical and deformed potential minimum. The three parameters of the Hamiltonian have been determined by a weighted least square fit procedure. Trends in the location of states belonging to the ground-state, the $K^{\pi}=2^+$ and two excited $K^{\pi}=0^+$ bands have been analysed. The trajectory determined by the fitted parameters in the two-dimensional phase space has also been plotted, and it has been found that all the nuclei are characterized by a deformed potential minimum, except for the heaviest Pt isotope ($^{198}$Pt), for which the transition to the spherical shape phase is realised. Although the spectroscopic information on the next isotopes of the chains ($^{200}$Pt and $^{194}$Os) is far less complete, there are indications that these nuclei are also close to or fall within the domain of spherical potential minimum.