Trains aren't inherently peak or off-peak - whether you can take a particular train depends on the fare you buy, and the restriction code associated with that fare.
A Huddersfield to Knaresborough Off-Peak Day Return has restriction code I2 - you can look this up at nre.co.uk/I2. This means it's valid from 09:15 onwards, with no evening peak. Therefore you are entirely permitted to take the 16:39 from Knaresborough on your way back.
A different restriction code would apply if you were buying a Huddersfield to Leeds Off-Peak Day Return, which would mean there would indeed be evening restrictions. In general, most Off-Peak fares for journeys entirely within either West Yorkshire, South Yorkshire or Greater Manchester (and a handful of adjoining stations) have evening peak restrictions. But Knaresborough is in North Yorkshire so there aren't any evening peak restrictions on the Off-Peak fare from Huddersfield. Equally, the fare is more expensive because it's not subsidised by the local councils, so it's a case of swings and roundabouts.
This is also why, when you asked about Huddersfield to Leeds, TPE correctly told you that there would be evening restrictions - they probably assumed you were asking about buying a Huddersfield to Leeds tickets. But as you aren't buying that ticket, the restrictions that apply to such a ticket aren't relevant to your Huddersfield to Knaresborough ticket.
It is also worth pointing out that, even if a retailer such as Trainline or TPE had made a mistake (they haven't) and had 'wrongly' offered an Off-Peak ticket at a time of day when it wasn't valid, you are entitled to rely on the information you're given when buying your ticket. Therefore your ticket would be contractually valid on the offered trains, and the train companies would have to accept your ticket. They can take it up with Trainline etc. if they are unhappy.