https://github.com/GPUOpen-LibrariesAndSDKs/HelloVulkan/blob/master/hellovulkan/src/VulkanSample.cpp#L730-L750
Here you setup a resource transition for each image in the swapchain which you run during initialize without acquiring them. This is not allowed.
https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/xhtml/vkspec.html#_wsi_swapchain
Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR, and before it is presented by vkQueuePresentKHR. This includes transitioning the image layout and rendering commands.
Instead you can set the initialLayout of the renderpass attachment to VK_IMAGE_LAYOUT_UNDEFINED. Implying that you don't care about the existing data (which is made explicit by the op_load_clear).