Yeh it is complex and that is why the copyright issue remains. She wrote a personal diary, then heard that there may be publication opportunities after the war (this is during the war) so rewrote parts of it and wrote many notes while obscuring the people involved. Her father inherited the copyright and modified the diaries to remove some of the more personal family things from the recollections while also adding back the correct family name (but not correcting the friends pseudo names ). Then it was modified by publishers in various regions to remove sexual thoughts (which has been done in various counties in the US recently, again!).
So Anne Franks father was an editor but also had a copyright claim and also substantially modified her work. That means there are different copyrights at work here. Her origional ones and the ones obtained/extended by her father producing modified versions (which he had a right to do)