The first entry on https://en.wikipedia.org/api/rest_v1/page/html/June_26 is from the year "4 AD". The onthisday endpoint skips this since "4 AD" is not recognized as a year based on the regex:
yearListElementRegEx : /^\s*(\d+)\s*(bce?)?\s*–\s(.+)/i
Complicating this is that (bce?) in the regex (the 2nd group is used the determine if the year is negative, and the third group is used to get the remaining text (in all languages). In the AD case the year should still be positive.
The entry for the year 4 AD is included.
The entry for the year 4 AD is not included.