manufacturers datasheets, RF appnotes etc all mention this, with results for different usecases (like gnd plane size etc). I mentioned it a few times on the forum:
nothing under or near antenna (keep out zone)
their matching circuit, and CE/FCC certif are based on their development boards+their antenna if external, often without enclosure.
there are a very few pcb antennas which are resilient to untuning. ceramic or meandered pcb are usually more compact but less resilient (like when you approach your hand and device suddently has better or worst communication)
once you change any of these parameters (board shape, gnd size, enclosure etc), it breaks FCC, and may need retuning, still you can get useable range.
"ideally" tuning should be done once enclosed for example. manufacturers can't cover all cases.
on my side, I try to follow these rules. and when interested in a design or a device, I check this. Mainly the routing+gnd, antenna choice, keepout zone, and orientation vs my usecase (long range needed or not for example)
@berkseo Good question. The code seemed good at the time I wrote it, but I can't say that it was extensively tested. I may circle back to it at a future date, and if so, I'll take a closer look. Even with more than 500 downloads of the code, no one has posted any feedback on how well (or not) it has run. Also, I not sure how compatible the posted code is with newer releases of the mysensors library.