It could be a max_user_connections
issue, some heavy WordPress sites have the tendency to cause those.
Every database user is only allowed to have a limited number of database connections. If that limit is hit, additional connections cannot be opened until the number of active connections is reduced. This could explain why you only get the error sometimes: even a website that uses too many database connections will only sometimes see this issue.