I had this issue on my "new" 2022 GT Line (no
mods). It was a dealership return/buy-back with 3K miles on it. The car did exactly what OP described: If I floored it, it would go to 5K rpm, stop there, and just stop accelerating. If I accelerated smoothly/slowly, no hang. Dealership noticed the smaller coolant tank was empty. Diagnosed a leak in the radiator. Pink coolant spray everywhere between the radiator and the engine. New radiator on order. While waiting for the radiator to come in, I keep the coolant tank full and the hang does not happen. There was never any error code or check-engine light. I believe this "problem" to be a generic protection mode caused by any condition that would cause serious harm to the engine.