The Present Windows Effect lags (is not animated) on the first activation if close buttons are enabled. Maybe its caused by CloseWindowView: The object is created on the fly @PresentWindowsEffect::setActive, it also creates a QQuickView and calls QStandardPaths::locate. KWin support information: https://paste.kde.org/p69nzabhw
It probably is the CloseWindowView, but my first thought was when reading your report was: "probably NVIDIA". Unfortunately that guess is right. NVIDIA is still really slow in such situations. We are caught between a hard and a rock place here. Either we move this out of first invocation (then startup is slower) or we have the lag on first startup. As this seems to be mostly an NVIDIA problem the general solution is unfortunately that we keep it as it is.