LogWindows: Error: appError called: Assertion failed: Actor->GetLevel()

I get these errors during the cooking process using the ProjectLauncher.
qqqq

LogOutputDevice: Warning: 

Script Stack (0 frames) :

LogWindows: Error: appError called: Assertion failed: Actor->GetLevel() == this [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 571] 


LogWindows: Windows GetLastError: The operation completed successfully. (0)
LogWindows: Error: begin: stack for UAT
LogWindows: Error: === Critical error: ===
LogWindows: Error: 
LogWindows: Error: Assertion failed: Actor->GetLevel() == this [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 571] 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: [Callstack] 0x00007ffc42995587 UnrealEditor-Engine.dll!`TActorDescContainerInstanceCollection<TObjectPtr<UActorDescContainerInstance> >::GetActorDescInstance'::`2'::<lambda_1>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp:571]
LogWindows: Error: [Callstack] 0x00007ffc42a1c518 UnrealEditor-Engine.dll!ULevel::Serialize() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp:564]
LogWindows: Error: [Callstack] 0x00007ffc814d3ea7 UnrealEditor-CoreUObject.dll!FPackageHarvester::ProcessExport() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage\PackageHarvester.cpp:519]
LogWindows: Error: [Callstack] 0x00007ffc814ca1f3 UnrealEditor-CoreUObject.dll!`anonymous namespace'::HarvestPackage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:374]
LogWindows: Error: [Callstack] 0x00007ffc814cb4d1 UnrealEditor-CoreUObject.dll!`anonymous namespace'::InnerSave() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:2959]
LogWindows: Error: [Callstack] 0x00007ffc814de310 UnrealEditor-CoreUObject.dll!UPackage::Save2() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp:3134]
LogWindows: Error: [Callstack] 0x00007ffc814de5d9 UnrealEditor-CoreUObject.dll!UPackage::Save() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage.cpp:20]
LogWindows: Error: [Callstack] 0x00007ffc393b3ea7 UnrealEditor-UnrealEd.dll!UEditorEngine::Save() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:4837]
LogWindows: Error: [Callstack] 0x00007ffc3913a027 UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:6172]
LogWindows: Error: [Callstack] 0x00007ffc3911e128 UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::PumpSaves() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:4738]
LogWindows: Error: [Callstack] 0x00007ffc391471e7 UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::TickMainCookLoop() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:1464]
LogWindows: Error: [Callstack] 0x00007ffc39146624 UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::TickCookByTheBook() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp:1346]
LogWindows: Error: [Callstack] 0x00007ffc38e21de0 UnrealEditor-UnrealEd.dll!UCookCommandlet::RunCookByTheBookCook() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp:555]
LogWindows: Error: [Callstack] 0x00007ffc38de30cd UnrealEditor-UnrealEd.dll!UCookCommandlet::CookByTheBook() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp:508]
LogWindows: Error: [Callstack] 0x00007ffc38dfe910 UnrealEditor-UnrealEd.dll!UCookCommandlet::Main() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp:249]
LogWindows: Error: [Callstack] 0x00007ff7cc6595fd UnrealEditor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4194]
LogWindows: Error: [Callstack] 0x00007ff7cc64f606 UnrealEditor-Cmd.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:136]
LogWindows: Error: [Callstack] 0x00007ff7cc64f8ea UnrealEditor-Cmd.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
LogWindows: Error: [Callstack] 0x00007ff7cc652dc4 UnrealEditor-Cmd.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
LogWindows: Error: [Callstack] 0x00007ff7cc6688c4 UnrealEditor-Cmd.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
LogWindows: Error: [Callstack] 0x00007ff7cc66aee6 UnrealEditor-Cmd.exe!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
LogWindows: Error: [Callstack] 0x00007ffcb8157344 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: 
LogWindows: Error: end: stack for UAT
LogExit: Executing StaticShutdownAfterError
LogWindows: FPlatformMisc::RequestExit(1, LaunchWindowsStartup.ExceptionHandler)
LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3, LaunchWindowsStartup.ExceptionHandler)
LogCore: Engine exit requested (reason: Win RequestExit)

This is how my latest error looks like.

[2024.05.01-16.54.22:268][  0]LogOutputDevice: Warning:

Script Stack (0 frames) :

[2024.05.01-16.54.22:358][  0]LogWindows: Error: appError called: Assertion failed: Actor->GetLevel() == this [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 571]


[2024.05.01-16.56.04:175][  0]LogWindows: Error: === Critical error: ===
[2024.05.01-16.56.04:175][  0]LogWindows: Error:
[2024.05.01-16.56.04:175][  0]LogWindows: Error: Assertion failed: Actor->GetLevel() == this [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 571]
[2024.05.01-16.56.04:176][  0]LogWindows: Error:
[2024.05.01-16.56.04:176][  0]LogWindows: Error:
[2024.05.01-16.56.04:176][  0]LogWindows: Error:
[2024.05.01-16.56.04:176][  0]LogWindows: Error:
Waited for 60.10s for output of D:\EpicGames\UE_5.4\Engine\Binaries\Win64\UnrealEditor-Cmd.exe, some output may be missing; we gave up.
Took 1,190.22s to run UnrealEditor-Cmd.exe, ExitCode=3
Cook failed.
(see C:\Users\shojib\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+EpicGames+UE_5.4\Log.txt for full exception trace)
AutomationTool executed for 0h 22m 40s
AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
BUILD FAILED

Are you play in PIE?

In my case, WorldDataLayer Actor cause same error to me
try disable WorldPartion option in world setting

Check if you are using External Actors. Maybe try toggling it on and off for all the levels to get it cooking again.