"The app could not be installed as a local app as it has previously been installed from Atlassian Marketplace" for marketplace install

According to what I’ve been reading about this problem, this is a change in UPM to avoid Jira administrator to get confused between marketplace listed apps and development apps.

Another article here

Point is, that if a previous installation has been made with an app in private mode (and an app which has never been publicly listed), then there is no confusion possible.

I would then suggest that this limitation does not happen if the app was never listed publicly in the marketplace.

My 2 cents.