It is only a hard and fast rule in the sense that you must apply before the 6 month cutoff if you want to be entitled to a free I-551 stamp in the event that your N-400 is still pending when your green card has expired or is almost expired.
However, if you apply slightly after the 6 month cutoff, it is still possible (but not guaranteed) that they would give you a free I-551 stamp at their discretion. And it is also likely that you will complete the naturalization process before your green card expires, given that you will have more than 5 months remaining when the N-400 application arrives at USCIS.
If you work for a living, make sure you have a Social Security card without the employment restriction wording on it, so you can you use that card* in case you need to change jobs after your green card expires and before you become a US citizen. Once you have that, given that you're not travelling outside the US this year the only thing you really have to worry about is if your green card expires before the naturalization interview, or if you live near one of those border checkpoints where they frequently stop people to check their status.
*the unrestricted SS card must be combined with another ID on list B of the I-9; it is not sufficient by itself. And the name on it needs to match the name on your ID.