Are you pointing cloudflare directly to Lemmy? I have mine going from cloudflare to Nginx Proxy Manager configured to serve Lemmy.
There is some additional configuration necessary for a reverse proxy in front of Lemmy, which is potentially where things are getting messed up for you?