I'm also not sure why they're not formatted properly.
Usually a lemmy client expects a certain kind of response after fetching a post. If it's different than what it should be (like this error), it often just outputs whatever else came. In this case it's a raw JSON encoded string.
There are ways to avoid this, and to output a nicely formatted error but usually the effort it takes is not worth the benefit it provides.