This doesn't solve the discrete issue, but the secondary axis need not be a duplication of the primary axis. So on "side=4" I can put a transformation of the "side=2" axis.
See more here:
https://ggplot2.tidyverse.org/reference/sec_axis.html
e.g., scale_y_continuous(sec.axis = sec_axis(~ . + 10))