I figured it out, it's apparently a bug in the Jerboa for Lemmy app. Jerboa sees PDF and tries to open my default PDF viewer rather than my web browser Fennec.
When I copy the link and paste it directly in Fennec, it works as expected, but when I tap the link in Jerboa, it's blindly trying to open it with a PDF app, which gives the Invalid Format error.