Works whether or not my 2018 MacBook Pro is in clamshell mode (with Bluetooth keyboard and mouse) or not. By "steps that are on apple's website" I hope you mean this very thorough Apple Support article:
Universal Control: Use a single keyboard and mouse between Mac and iPad - Apple Support
Although it's easy to overlook some things there. In particular: on Macs make sure you turn on all three of settings in the the System Preferences -> Displays -> Universal Control panel (all marked "Beta"). And "Allow Handoff" in System Preferences -> General. On iPads, in Settings -> General -> AirPlay & Handoff, turn on both Handoff and Cursor and Keyboard (Beta).
If it still doesn't work, check out everything outlined in this MacRumors troubleshooting guide:
https://www.macrumors.com/guide/universal-control-troubleshooting/