I'm not familiar with that FreqPeriodCounter library, so I don't know whether you're using it correctly. Is it actually producing an accurate and consistent measurement? Is the FreqPeriodCounter object designed to be used in an interrupt context? I'd expect it to need some care to deal with volatile data and disabling interrupts around access to them. If it doesn't do that correctly, you can end up with spurious behaviour. If you get garbage in, nothing else is going to work.
Since the loop() function looks pretty fast, you could probably just poll the input pin state and from the name I guess that the poll() method was designed to do that. That's a hint it might not be designed to be used in an interrupt context.
There is no need to make period volatile since it is never accessed in an interrupt context.
There's a minor bug in your output timing code which could cause the output to slip slightly - I don't think this is causing your problem but I suggest you correct it anyway by changing line 32 to:
previoustime += interval;