We demonstrate the consistency of the quark deconfinement phase transition parameters in the beta-stable neutron star matter and in the nearly symmetric nuclear matter formed in heavy-ion collisions (HICs). We investigate the proton and $\mathrm{\ensuremath{\Lambda}}$ flow in $\mathrm{Au}+\mathrm{Au}$ collisions at 3 and $4.5\text{ }\text{ }\mathrm{GeV}/\mathrm{nucleon}$ incident beam energies with the pure hadron cascade version of a multiphase transport model. The phase transition in HICs and neutron stars is described based on a class of hybrid equations of state from the quark mean-field model for the hadronic phase and a constant-speed-of-sound parametrization for the high-density quark phase. The measurements of the anisotropic proton flow at $3\text{ }\text{ }\mathrm{GeV}/\mathrm{nucleon}$ by the STAR Collaboration favor a relatively low phase transition density lower than $\ensuremath{\sim}2.5$ times saturation density indicated by the gravitational wave and electromagnetic observations of neutron stars. And the proton flow data at the higher energy of $4.5\text{ }\text{ }\mathrm{GeV}/\mathrm{nucleon}$ can be used to effectively constrain the softness of high-density quark matter equations of state. Finally, compared to the proton flow, the $\mathrm{\ensuremath{\Lambda}}$ flow is found to be less sensitive and not constraining to the equations of state.