QoS2 messages are not deleted when the limit is reached

I’m interested in a situation where mqtt client doesn’t send PUBREL for some messages and after that my queue (maximum number of pending PUBREL) is full.

After this my client reconnects and is unable to send messages because my queue (maximum number of pending PUBREL) is full.
My client has a session_expiry_interval property because it is important for the client to receive messages.
After reconnecting, my client is not aware of the previous messages.
I’m looking for a way to allow my client to send messages after reconnecting. As I understand it, this requires that the maximum number of waiting PUBRELs stops being full.
Now I have Max Awaiting PUBREL Timeout = 300s, clean_session = False. Could you please advise if I’m doing everything correctly and if there are any other client parameters that need to be configured?

Hello,

After reconnecting, my client is not aware of the previous messages.

Just to clarify, the client is not aware of the QoS2 messages that it published to the broker? If so, this situation breaks the QoS2 message flow, that is built around ownership transfer of the messages. When the client resumes a session without clean flag, it is supposed to complete all QoS2 message transfers that it had previously initiated. If client cannot do that, perhaps it can just publish the messages with QoS1?