I finally built my 3rd settlement near the volcano biome, basically it was in the middle of a bit of plains, volcano on the right and forest on the left. Now with my first settlement, it was big enough that it can reach the forest biome and I tried building a farm to plant apple trees and it didn't work. I figured it may still be plains despite looking like forest so I decided to try it again later on.
Now, with this settlement, there were literally apple trees that grew on the very spot I built my farm on. And yet, it's still showing "incorrect biome" when I finally tried planting them. I saw somewhere that the area gets "converted" into whatever biome the flag is on, which is plains for this one, but why is it that the rules don't apple for the Mine, wherein it still shows that it's on volcano biome and it looks like volcanic rock instead of the original and it is mining volcanic resources, but for farms, it becomes invalid for the farmland on a different biome? This is so confusing????
Edit: Thanks for the replies guys, it seems where I built farmland was literally 2 tiles away from the valid forest tile despite already looking like it and despite apple trees literally growing on the supposedly invalid forest tile, which still seems ridiculous to me but at least I now know where to plant.