In Package.swift
// swift-tools-version:5.3
Although it’s a comment and it should be ignored, it’s not! change it to :
// swift-tools-version:5.2
Sometimes you need to delete .build
and .swiftpm
directories (that are hiddent by default) too.
Note
Don’t forget to close and reopen the project after the changes.