There's a good chance you may run into trouble, but it's difficult to guess whether you will, how much trouble, and if that can be sorted out easily.
Originally, PNRs and boarding passes were completely independent from any passport info, so in that respect, you could have done what you propose without an issue (but see below for other possible complications).
Nowadays, many countries (but not all) require Advance Passenger Information (API, also known by a variety of other names and acronyms). In that case the airline needs to collect that information from you, store it in their systems, and forward it to the destination country (and the origin country in some cases, especially for countries with no exit checks like the UK, the US, Ireland..., and in some other cases also countries overflown, like the US).
Entering the information can happen during booking, while editing your API info online afterwards (many airlines ask you to do so in advance), at check-in desks or kiosks, or even sometimes at the gate (though in most cases, if API is required, you will not get a boarding pass issued before you have entered the data).
Transmission of the info to the countries which require it may happen at different times, ranging from as soon as you enter it (e.g. during booking) to just after the plane has left, with possible intermediate options at "X days/hours before departure", "when you check in", "when you board" and possibly more.
In some cases it's just a one-way flow (airlines sends the info to the country which requires it, and any action they wish to take if they don't like something is taken via other channels) or it may elicit an answer ("BOARD" / "DO NOT BOARD").
It is quite possible to change API information entered at booking time for instance once you perform check-in (online, or at the airport). This is frequent if you had to get a new passport before your flight. It also may happen without you even noticing if you present a passport different from the one you already entered (at check-in, or sometimes at the gate if you didn't go through a check-in desk or kiosk): they will notice the passport is different and update the data.
Now, I have no idea whether this information can still be changed once you have checked-in and boarding passes have been issued. I would guess it should be possible, but it may depend a lot on the destination country, possibly on your citizenship, and probably the airline as well.
It's also possible that you just show up at the gate, you show your passport, they just check the name and picture and maybe the country of the passport and off you go, nobody noticed anything.
Now, another issue is that when you renew your passport, the previous one will be cancelled. Some countries send such information to some other countries, though how quickly this is done probably varies a lot (from instant to a batch every couple of months for instance).
If you're unlucky enough that your country advises the destination country that your passport is cancelled right away, this may trigger an alert that someone is trying to travel with a cancelled passport. Does not smell very good, though hopefully this can be sorted out easily, as there are quite a few very legitimate cases where that can happen.
Finally, there's the issue of any related travel authorisation, like ESTA, ETA, eVisit, eVisitor, etc. Those are usually linked to your passport, and new passport means new application, which can take from a few minutes to a few days, and you won't be able to apply before you have your new passport in hand.
If the destination country requires one of those, I would very strongly recommend against your plan.
As you see, lots of unknowns. Maybe nobody will notice. Maybe it will be as simple as handing in your new passport at the gate. Maybe you're set for an hour of checks and verifications and whatnot. Maybe you end up not being able to board at all.
With more details about the countries involved someone may be able to tell you more (for instance if the destination country requires API or not), but many of the details are quite specific and probably not very public.