I recently found the wl-mirror program and it is great:
https://github.com/Ferdi265/wl-mirror
It allows you to create a window that reproduces the contents of a
Wayland display. This is particularly useful if you use a compositor
that does not (as of this writing) support screen mirroring, such as
Sway. To "mirror" my laptop screen onto a projector, I simply use
wl-mirror to create a window replicating my laptop screen, and then
put the wl-mirror window in full screen on the workspace corresponding
to the projector.
Instead of battling the mirroring functionality built into a window
manager or compositor, I have a separate program where I can easily
tweak things such as scaling (if applicable) to my desire. For that
matter, wl-mirror also supports only mirroring only a subset of a
screen. It's a delightful, composable tool.