  Heavy $c\bar c$ and $b\bar b $ quarkonia are considered as systems confined
within a hard-wall potential shaped after a linear combination of a cotangent--
with a square co-secant function. Wave functions and energy spectra are then
obtained in closed forms in solving by the Nikiforov-Uvarov method the
associated radial Schr\"{o}dinger equation in the presence of a centrifugal
term. The interest in this potential is that in one parametrization it can
account for a conformal symmetry of the strong interaction, and in another for
its perturbation, a reason for which we here employ it to study status of
conformal symmetry in the heavy flavor sector. The resulting predictions on
heavy quarkonia mass spectra and root mean square radii are compared with the
available experimental data, as well as with predictions by other theoretical
approaches. We observe that a relatively small conformal symmetry perturbing
term in the potential suffices to achieve good agreement with data.
