The spell Wish states:
The basic use of this spell is to duplicate any other spell of 8th level or lower. You don't need to meet any requirements in that spell, including costly components. The spell simply takes effect.
However, 5th-level Teleportation Circle and 6th-level Guards and Wards include the following lines:
You can create a permanent teleportation circle by casting this spell in the same location every day for one year. (Teleportation Circle)
You can create a permanently guarded and warded structure by casting this spell there every day for one year. (Guards and Wards)
As such, which of the following cases of casting Teleportation Circle or Guards and Wards with the basic use of Wish (without suffering weakness) is correct / intended:
- You can use Wish to instant-cast the permanent versions of Teleportation Circle and Guards and Wards, bypassing the "every day for one year" requirement.
- The permanent form is a side effect of the repeated casting, such that Wish only performs 1 of 365 necessary casts.
- As Wish duplicates the spell, it will not count at all towards your daily quota for a permanent Circle / Warded Area.
This doesn't work (Option 3*).
The provisions you mention for Teleportation Circle and Guards and Wards are part of the spell effect, not a requirement to cast the spell. You aren't casting a different spell or even a different mode of spell when you cast it that final, 365th time. Rather, you cast the spell as normal, and then because of when and where you cast it (in a place where that same spell had been cast 364 times before), something extra happens on top of the normal spell effect.
You could almost certainly create a permanent portal or warded area using the open-ended version of Wish, though of course that would entail the 33% chance of not being able to cast it again as usual.
As for casting the spell through Wish, that wouldn't work by RAW. By the wording on Wish, you aren't actually casting Teleportation Circle or Guards and Wards, you are casting Wish, with the effects of the other two spells swapped in. "this spell" will refer to Wish when you duplicate it this way.
*However this does open up an extra method. If you cast Wish in a location every day for 364 days, then you can use it to cast Teleportation Circle and/or Guards and Wards on the 365th (or later) day to get the permanent effects of those spells. Notably, it doesn't matter what spell you use Wish to cast, as long as you cast some spell each day. You could even use the non-duplicating version of Wish if you so choose, as long as you don't lose the ability to cast it of course.
So for example, you could spend 364 days using Wish to cast Wall of Stone on the same spot, creating a wizard fortress, and then on the 365th and 366th day use Wish to cast Teleportation Circle and Guards and Wards to permanently create those effects in your new home. You could even keep casting these on later days to set up additional Guards and Wards and/or Teleportation Circles if you wish, as long as you cast them from the same position.