Nobody uses RSA to directly encrypt data transmitted over http (web) or SMTP (email). 2048 bit RSA would only allow you to encrypt 245 bytes at a time, and each such operation is expensive.
Protocols get one of the parties or both parties together to generate a new random number that is long enough to be unguessable and unique. 128 bits are enough, though TLS uses more. Then they use this number as a symmetric encryption key (technically, seed for KDF), which allows them to quickly encrypt a lot of data.
If the CSPRNG is backdoor-ed, adversary can predict the shared secret key. If the shared key is not secret, you completely break the security.
If one of the parties generated the shared secret key, they must transmit it to the other party, in a way that is immune to eavesdropping. A simple way is to encrypt the shared secret key using the recipient's public key. PGP does this, and older SSL/TLS did this.
A problem with transmitting the shared random secret key encrypted with the recipient's public key is that if you get your hands on the recipient's private key, maybe years later when they no longer use this keypair, you can decrypt previously recorded ciphertexts. So a junked hard drive with the private key for a long ago expired TLS server certificate would allow e.g. the NSA to decrypt years of old traffic.
Newer protocols demand use of better scheme: Diffie Hellman to establish an anonymous shared secret, and digital signatures to prove other party is who they say they are.
In modern protocols, RSA is only used for signing and verifying signatures.
Note: You may have read an explanation of RSA signatures as a kind of encryption. It is a very bad explanation, don't use it.
Note that textbook RSA is insecure and must not be used. You must use secure padding schemes for RSA encryption and for RSA signatures. The padding schemes for the two use cases have different goals and are different. Mixing them up is insecure.
Note that old TLS used pkcs#1v1.5, it's now considered insecure, use RSASSA-PSS instead.
As you've noticed implementing RSA securely is difficult, modern recommendation is to use better cryptographic primitives, like those in libsodium (or better yet, libsodium itself).