Star Trek: Strange New Worlds and Crusader Kings 3. So it’s either a time travel episode or something like those “planet closely resembling a period of earth history” episodes in TOS. Considering there are no records of Tomàs the wise, king of Ireland and Aquitaine, probably the latter.
There was the episode with Scotty in TNG (Relics) where there was indeed the problem of the pattern of the person who was in the buffer with him degrading, but that was over decades (2294-2369), while M’Bengas daughter was in the pattern buffer significantly less time. She was also rematerialised from time to time and it was noted that not doing so risked the integrity of the pattern, which contributed to the issue seen in the TNG episode.