Well, yeah, if you try to parse a
string like '2022-04-25' using the format 'MM/dd/uuuu' it isn't going to work. The most straightforward fix would be to use a format which matches the format of the strings you're producing.
Although I find it a bit odd that the second line is working with something which understands dates, then turns it into a string only to immediately convert the string to something which understands dates. Wouldn't converting from the date-understanding thing directly to LocalDate be more reliable?