The Warlock Pact Magic feature says:
The Spells Known column of the Warlock table shows when you learn more warlock spells of your choice of 1st level and higher. A spell you choose must be of a level no higher than what’s shown in the table’s Slot Level column for your level. When you reach 6th level, for example, you learn a new warlock spell, which can be 1st, 2nd, or 3rd level.
Additionally, when you gain a level in this class, you can choose one of the warlock spells you know and replace it with another spell from the warlock spell list, which also must be of a level for which you have spell slots.
Consider a single-classed warlock leveling up from level 4 to level 5, where their Pact Magic spell slots change from 2nd level to 3rd level. They can replace a warlock spell they know with a spell from the warlock spell list which "must be of a level for which they have spell slots," and they don't have 2nd level spell slots anymore. Can the warlock therefore only replace a warlock spell they know with a 3rd level warlock spell? Or can they learn a new 2nd level warlock spell instead?
(The word "also" suggests the same conditions apply as in the previous paragraph, but the first paragraph uses different wording -- "a level no higher than what's shown in the table's Slot Level column," and the second paragraph refers to "a level for which you have spell slots.")
I am aware that this answer claims the interpretation that you can learn lower-level spells, but it doesn't give any justification for that interpretation or discuss the specific wording.