Reading between the lines here...

> he basically tells me this project should have been finished a long time ago

Your boss' boss will always say this. The problem is the person in between. That person has been too afraid to tell their boss why things are running late, or can't. Basically, your boss has to stick up for you to their boss and take the heat and pass it down.

> He looks at the code and criticizes design decisions, some of which were made largely on my manager's explicit suggestions. (When I bring this up, he says I probably just misinterpreted an offhand comment of hers as a hard requirement.)

Ooof. This person may be covering for your boss for some reason (human or otherwise). This sounds like a bad dynamic. For example, he might be cutting her slack for some reason.

> Part of the reason it had taken so long is because I put a substantial amount of work into a part of the project that's no longer necessary due to changing requirements

ALWAYS push back on these. It is your job to (at least try hard to) stand firm on the original plan and if they want to make changes midstream, you must demand more time in exchange (as much as you think is necessary, and then add 50%). It is already hard enough as a developer to plan timely releases WITHOUT the ground shifting underneath you. It is your responsibility to make that clear. And you should be communicating on expectations regularly... in consulting that's called "managing expectations" and it's a good life skill generally.

> He did also make some criticisms that I thought were fair

It's always fine to acknowledge these.

> I have no clue what happened in that meeting and I haven't heard anything about it from either of them since.

Worry about the things you can control; there's no point to worrying about things you can't.

> I really did work hard, so it's demotivating that it feels like the result of me working hard is unappreciated. I'm not thinking of quitting over this or anything, but it seriously bums me out.

I'm still thinking that the problem is your immediate boss. Also, you should absolutely voice this concern to her.

> and I'm thinking that now they probably feel that they could fire me if they wanted and not lose much.

Two things. Don't screw over that guy just because you're afraid of that. And also, if it came to that, it's a fairly hot hiring market. Don't be afraid. Of all the times I've been let go (and there've been quite a few, partly because I had undiagnosed sleep apnea for YEARS), I always ended up in a better place.

> it feels like an inauspicious start.

It's true that your first few months at a company are judged harsher than after, because you haven't proven yourself yet. Just do a course correct and check in with boss on requirements more frequently if they are subject to change, and always push back on changes and press for more time, because you'll need it... midstream changes aren't magically easy to do. Don't burn time on making fancy abstract mechanisms, just focus on the simplest code that does the job, and always cover it with tests (make sure to incorporate that into your total dev time...)

If they still end up firing you anyway, it's OK, you did your best. Like I said, worry about the things you can control... if your boss and boss' boss have a weird dynamic which affects the perception of you, that's unfortunately not something you have control over

Good luck!