Efficient sizing and economic analysis of community battery systems is crucial for enhancing energy efficiency and sustainability in rooftop PV panel-rich communities. This paper proposes a comprehensive model that integrates key technical and economic factors to optimize the size and operation of the prosumer-owned battery, maximizing the financial returns over the life span of the battery. Sensitivity and uncertainty analyses were also conducted on a number of factors that are constantly changing over the years such as per-unit cost of the battery and interest rate. Monte Carlo simulations were utilized to replicate the unpredictable PV generations and the volatility of house load demands. The developed model is evaluated under three scenarios: a shared community battery for all houses, individual batteries for each house, and a combined system with an additional large load. Particle Swarm Optimization (PSO) is utilized to maximize the formulated objective function subject to the considered constraints. The findings indicate that integrating community batteries offered a substantial economic advantage compared to individual home batteries. The additional revenue stream of incorporating larger consumers looking to reduce their carbon footprint (e.g., commercial) returned a further augmented net present value (NPV). The influence of different tariff structures was also assessed and it was found that critical peak pricing (CPP) was the most prolific. The outcomes offer valuable insights for policymakers and stakeholders in the energy sector to facilitate a more sustainable future.